Bug 148767 - Range.selectNode cannot select a detached node
Summary: Range.selectNode cannot select a detached node
Status: RESOLVED DUPLICATE of bug 149490
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-09-03 18:32 PDT by Ryosuke Niwa
Modified: 2015-09-24 16:58 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2015-09-03 18:32:32 PDT
var div = document.createElement('div');
div.appendChild(document.createElement('p'));

var range = document.createRange();
range.selectNode(div.firstChild);

throws a INVALID_NODE_TYPE_ERROR but it shouldn't.

The problem is that checkNodeBA throws this exception when the root node of refNode is not a document, a document fragment, or an Attr node.

This bug was found by the newly added LayoutTests/http/tests/w3c/dom/ranges/Range-selectNode.html
Comment 1 Radar WebKit Bug Importer 2015-09-03 18:33:34 PDT
<rdar://problem/22570635>
Comment 2 Chris Dumez 2015-09-24 16:58:59 PDT

*** This bug has been marked as a duplicate of bug 149490 ***