According to the spec (http://dom.spec.whatwg.org/#dom-node-comparedocumentposition), if two nodes are not in the same tree, we should return DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC. But the current implementation mays not return that for nodes which are in different shadow trees.
Created attachment 176468 [details] Fix Node::compareDocumentPosition for nodes in shadow tree.
Comment on attachment 176468 [details] Fix Node::compareDocumentPosition for nodes in shadow tree. Clearing flags on attachment: 176468 Committed r136087: <http://trac.webkit.org/changeset/136087>
All reviewed patches have been landed. Closing bug.