class Node
number compareDocumentPosition(Node n)
When comparing two attribute nodes; 32
is returned if they have the
same ownerElement
, otherwise 0
. This is probably not standard,
but it’s what Firefox return, so we do the same.
DOCUMENT_POSITION_DISCONNECTED = 1; DOCUMENT_POSITION_PRECEDING = 2; DOCUMENT_POSITION_FOLLOWING = 4; DOCUMENT_POSITION_CONTAINS = 8; DOCUMENT_POSITION_IS_CONTAINED = 16; DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
See http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html#Node3-compareDocumentPosition.
n
- node to compare against.0
for nodes are equals or a number with some of the above bits set.
boolean contains(Node n)
n
- node to compare against.true
if this
node cotains node n
.
Node
class with additional functionality.Not available in Internet Exporer which don’t have a
Node
class.See http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/core.html#ID-1950641247.