Index: LayoutTests/fast/dom/shadow/compare-document-position.html |
diff --git a/LayoutTests/fast/dom/shadow/compare-document-position.html b/LayoutTests/fast/dom/shadow/compare-document-position.html |
index 099e564b7aaee86ddf4b170ebb286805de53f1af..dbfbde7eece09113d9309914ce9d78e600709c90 100644 |
--- a/LayoutTests/fast/dom/shadow/compare-document-position.html |
+++ b/LayoutTests/fast/dom/shadow/compare-document-position.html |
@@ -45,10 +45,15 @@ function testCompareDocumentPosition() |
shouldBe('b2.compareDocumentPosition(b1)', 'Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING'); |
shouldBe('b2.compareDocumentPosition(b3)', 'Node.DOCUMENT_POSITION_FOLLOWING'); |
- // The current implementation does not return FOLLOWING OR PRECEDING flag. |
- // We need a stable implementation which decides the total order between nodes in different shadow trees. |
- shouldBe('a1.compareDocumentPosition(b1)', 'Node.DOCUMENT_POSITION_DISCONNECTED | Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC'); |
- shouldBe('b1.compareDocumentPosition(c1)', 'Node.DOCUMENT_POSITION_DISCONNECTED | Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC'); |
+ // Nodes in different shadow trees. |
+ shouldBeNonZero('a1.compareDocumentPosition(b1) & Node.DOCUMENT_POSITION_PRECEDING || a1.compareDocumentPosition(b1) & Node.DOCUMENT_POSITION_FOLLOWING'); |
+ shouldBe('a1.compareDocumentPosition(b1) & Node.DOCUMENT_POSITION_DISCONNECTED', 'Node.DOCUMENT_POSITION_DISCONNECTED'); |
+ shouldBe('a1.compareDocumentPosition(b1) & Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC', 'Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC'); |
+ shouldBe('a1.compareDocumentPosition(b1)', 'a1.compareDocumentPosition(b1)'); |
+ shouldBeNonZero('b1.compareDocumentPosition(c1) & Node.DOCUMENT_POSITION_PRECEDING || b1.compareDocumentPosition(c1) & Node.DOCUMENT_POSITION_FOLLOWING'); |
+ shouldBe('b1.compareDocumentPosition(c1) & Node.DOCUMENT_POSITION_DISCONNECTED', 'Node.DOCUMENT_POSITION_DISCONNECTED'); |
+ shouldBe('b1.compareDocumentPosition(c1) & Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC', 'Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC'); |
+ shouldBe('b1.compareDocumentPosition(c1)', 'b1.compareDocumentPosition(c1)'); |
} |
testCompareDocumentPosition(); |