RESOLVED FIXED 148774
Range.intersectsNode() does not behave according to the specification when start / end are equal
https://bugs.webkit.org/show_bug.cgi?id=148774
Summary Range.intersectsNode() does not behave according to the specification when st...
Ryosuke Niwa
Reported 2015-09-03 19:30:52 PDT
When the range is "detached", (i.e. start/end are never set), Range.intersectNode should return false on DocType. This is what Firefox does. See https://dom.spec.whatwg.org/#dom-range-intersectsnode
Attachments
Patch (5.47 KB, patch)
2015-09-22 12:42 PDT, Chris Dumez
no flags
Radar WebKit Bug Importer
Comment 1 2015-09-03 19:31:16 PDT
Chris Dumez
Comment 2 2015-09-21 11:01:12 PDT
Ryosuke, what do you mean by detached range? It is impossible to detach a range as Range.detach() is a no-op. Also, which test is failing because of this (the bug doesn't say)?
Ryosuke Niwa
Comment 3 2015-09-21 12:04:39 PDT
I mean that when neither start nor end is set.
Chris Dumez
Comment 4 2015-09-21 12:24:28 PDT
(In reply to comment #3) > I mean that when neither start nor end is set. start and end are set to be the ownerDocument when the Range is constructed AFAIK.
Chris Dumez
Comment 5 2015-09-22 10:36:46 PDT
Failing test: imported/w3c/web-platform-tests/dom/ranges/Range-intersectsNode.html "Node 20 doctype, detached range" check.
Chris Dumez
Comment 6 2015-09-22 10:57:55 PDT
FYI, I am still trying to figure out what we're doing wrong. Range is constructed so we initialize its start / end to be the context document, as per the spec: https://dom.spec.whatwg.org/#dom-range-range Then it calls intersectsNodes(docType) and we return true, but the test expects false.
Chris Dumez
Comment 7 2015-09-22 12:42:21 PDT
WebKit Commit Bot
Comment 8 2015-09-22 15:27:46 PDT
Comment on attachment 261762 [details] Patch Clearing flags on attachment: 261762 Committed r190136: <http://trac.webkit.org/changeset/190136>
WebKit Commit Bot
Comment 9 2015-09-22 15:27:52 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.