Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: LayoutTests/fast/dom/shadow/compare-document-position.html

Issue 20042003: compareDocumentPosition() should report PRECEEDING or FOLLOWING information even if nodes are disco… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add failing test to TestExpectations Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698