-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
compareDocumentPosition returns incorrect values for detached nodes #777
Description
While implementing a solution for node.compares for #767 I have found that compareDocumentPosition returns incorrect values for detached nodes.
The Dom Standard specifies that nodes from separate document trees should return the result of adding DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC and either DOCUMENT_POSITION_PRECEDING or DOCUMENT_POSITION_FOLLOWING but the current implementation doesn't include code allowing it to return DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC. The WHATWG standard for compareDocumentPosition appears to have evolved somewhat from the DOM Level 3 core spec and I guess the jdsom implementation hasn't kept up.
I'm working on this as part of the solution for #767 but it's turning into a bit of a monster!