RESOLVED CONFIGURATION CHANGED 119325
compareDocumentPosition() reports an attribute and its content as disconnected
https://bugs.webkit.org/show_bug.cgi?id=119325
Summary compareDocumentPosition() reports an attribute and its content as disconnected
Chris Dumez
Reported 2013-07-30 23:37:09 PDT
Node::compareDocumentPosition() reports an attribute and its content as disconnected. Instead, the attribute should contain and precede its content. This is causing the following test case to fail: LayoutTests/dom/xhtml/level3/core/nodecomparedocumentposition38.xhtml I investigated the issue a bit and it seems the problem seems to be that Node::inDocument() returns false for the Text node (content) instead of true. Note that there is already a workaround in place in Node::compareDocumentPositionInternal() that addresses the same issue for Attribute nodes. See comment in that method: // Note that we avoid comparing Attr nodes here, since they return false from inDocument() all the time (which seems like a bug). It is likely we need to extend the workaround to Text nodes or fix the underlying problem (have inDocument() return correct values for Attr and Text nodes). Specification: http://dom.spec.whatwg.org/#dom-node-comparedocumentposition Corresponding Blink bug: http://code.google.com/p/chromium/issues/detail?id=264138
Attachments
Chris Dumez
Comment 1 2013-07-30 23:39:16 PDT
As explained by Adam in http://code.google.com/p/chromium/issues/detail?id=264138#c1, Attr should no longer be a Node according to the latest specification. It should be its own interface [1]. If we followed the spec, the bug would disappear. [1] http://dom.spec.whatwg.org/#attr
Ahmad Saleem
Comment 2 2024-03-17 15:30:35 PDT
Ryosuke Niwa
Comment 3 2024-03-18 10:15:52 PDT
Looks like this bug has been fixed by now.
Note You need to log in before you can comment on or make changes to this bug.