- From: <bugzilla@jessica.w3.org>
- Date: Tue, 16 Oct 2012 15:21:06 +0000
- To: public-webapps-bugzilla@w3.org
- Message-ID: <bug-19555-2532@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19555
Priority: P2
Bug ID: 19555
CC: bzbarsky@mit.edu, mike@w3.org, Ms2ger@gmail.com,
www-dom@w3.org
Assignee: annevk@annevk.nl
Blocks: 13044
Summary: Node.getDocumentPosition should return 0x23 or 0x25
for disconnected nodes, not 0x01
QA Contact: public-webapps-bugzilla@w3.org
Severity: normal
Classification: Unclassified
OS: All
Reporter: ayg@aryeh.name
Hardware: All
Status: NEW
Version: unspecified
Component: DOM
Product: WebAppsWG
See discussion here:
https://bugzilla.mozilla.org/show_bug.cgi?id=486002
IE, Firefox, and Opera all implement the DOM Level 3 Core spec. That means
that for any two given disconnected nodes, they'll return either
Node.DOCUMENT_POSITION_DISCONNECTED |
Node.DOCUMENT_POSITION_PRECEDING |
Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
or
Node.DOCUMENT_POSITION_DISCONNECTED |
Node.DOCUMENT_POSITION_FOLLOWING |
Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
consistently, as long as each one's root node has no parent. (In practice,
Gecko does a pointer comparison between pointers to the root nodes, where the
pointer used is unique and stable for any given node. Probably IE/Opera are
similar.)
This is meant to be used for sorting arbitrary lists of nodes uniquely. In
fact, jQuery exposes a function that does exactly that. But the current spec
says to just return 0x01, which very well might break jQuery. jQuery relies on
the sort being a total order because it passes a function based on it to JS'
.sort() method, which has undefined behavior for bogus sort functions.
In practice, the method is horrible enough (bitfields in JS!) that I don't
think it's worth making it prettier. I say we should just spec it like DOM
Level 3 Core. People can use .contains(), and we could add
.isBefore()/.isAfter() methods to round it out if we want.
--
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 16 October 2012 15:21:08 UTC