OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
5 <script src="resources/shadow-dom.js"></script> | 5 <script src="resources/shadow-dom.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <div id="sandbox"></div> | 9 <div id="sandbox"></div> |
10 <script> | 10 <script> |
(...skipping 27 matching lines...) Expand all Loading... |
38 c1 = getNodeInShadowTreeStack('a3/c1'); | 38 c1 = getNodeInShadowTreeStack('a3/c1'); |
39 | 39 |
40 shouldBe('a1.compareDocumentPosition(a2)', 'Node.DOCUMENT_POSITION_CONTAINED
_BY | Node.DOCUMENT_POSITION_FOLLOWING'); | 40 shouldBe('a1.compareDocumentPosition(a2)', 'Node.DOCUMENT_POSITION_CONTAINED
_BY | Node.DOCUMENT_POSITION_FOLLOWING'); |
41 shouldBe('a2.compareDocumentPosition(a1)', 'Node.DOCUMENT_POSITION_CONTAINS
| Node.DOCUMENT_POSITION_PRECEDING'); | 41 shouldBe('a2.compareDocumentPosition(a1)', 'Node.DOCUMENT_POSITION_CONTAINS
| Node.DOCUMENT_POSITION_PRECEDING'); |
42 shouldBe('a2.compareDocumentPosition(a3)', 'Node.DOCUMENT_POSITION_FOLLOWING
'); | 42 shouldBe('a2.compareDocumentPosition(a3)', 'Node.DOCUMENT_POSITION_FOLLOWING
'); |
43 | 43 |
44 shouldBe('b1.compareDocumentPosition(b2)', 'Node.DOCUMENT_POSITION_CONTAINED
_BY | Node.DOCUMENT_POSITION_FOLLOWING'); | 44 shouldBe('b1.compareDocumentPosition(b2)', 'Node.DOCUMENT_POSITION_CONTAINED
_BY | Node.DOCUMENT_POSITION_FOLLOWING'); |
45 shouldBe('b2.compareDocumentPosition(b1)', 'Node.DOCUMENT_POSITION_CONTAINS
| Node.DOCUMENT_POSITION_PRECEDING'); | 45 shouldBe('b2.compareDocumentPosition(b1)', 'Node.DOCUMENT_POSITION_CONTAINS
| Node.DOCUMENT_POSITION_PRECEDING'); |
46 shouldBe('b2.compareDocumentPosition(b3)', 'Node.DOCUMENT_POSITION_FOLLOWING
'); | 46 shouldBe('b2.compareDocumentPosition(b3)', 'Node.DOCUMENT_POSITION_FOLLOWING
'); |
47 | 47 |
48 // The current implementation does not return FOLLOWING OR PRECEDING flag. | 48 // Nodes in different shadow trees. |
49 // We need a stable implementation which decides the total order between nod
es in different shadow trees. | 49 shouldBeNonZero('a1.compareDocumentPosition(b1) & Node.DOCUMENT_POSITION_PRE
CEDING || a1.compareDocumentPosition(b1) & Node.DOCUMENT_POSITION_FOLLOWING'); |
50 shouldBe('a1.compareDocumentPosition(b1)', 'Node.DOCUMENT_POSITION_DISCONNEC
TED | Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC'); | 50 shouldBe('a1.compareDocumentPosition(b1) & Node.DOCUMENT_POSITION_DISCONNECT
ED', 'Node.DOCUMENT_POSITION_DISCONNECTED'); |
51 shouldBe('b1.compareDocumentPosition(c1)', 'Node.DOCUMENT_POSITION_DISCONNEC
TED | Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC'); | 51 shouldBe('a1.compareDocumentPosition(b1) & Node.DOCUMENT_POSITION_IMPLEMENTA
TION_SPECIFIC', 'Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC'); |
| 52 shouldBe('a1.compareDocumentPosition(b1)', 'a1.compareDocumentPosition(b1)')
; |
| 53 shouldBeNonZero('b1.compareDocumentPosition(c1) & Node.DOCUMENT_POSITION_PRE
CEDING || b1.compareDocumentPosition(c1) & Node.DOCUMENT_POSITION_FOLLOWING'); |
| 54 shouldBe('b1.compareDocumentPosition(c1) & Node.DOCUMENT_POSITION_DISCONNECT
ED', 'Node.DOCUMENT_POSITION_DISCONNECTED'); |
| 55 shouldBe('b1.compareDocumentPosition(c1) & Node.DOCUMENT_POSITION_IMPLEMENTA
TION_SPECIFIC', 'Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC'); |
| 56 shouldBe('b1.compareDocumentPosition(c1)', 'b1.compareDocumentPosition(c1)')
; |
52 } | 57 } |
53 | 58 |
54 testCompareDocumentPosition(); | 59 testCompareDocumentPosition(); |
55 </script> | 60 </script> |
56 <script src="../../js/resources/js-test-post.js"></script> | 61 <script src="../../js/resources/js-test-post.js"></script> |
57 </body> | 62 </body> |
58 </html> | 63 </html> |
OLD | NEW |