Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / selectors / querySelector-leftmost-selector-matches-ancestor.html
blob2b6ca0075b75c6db05c6e2290364767f3503af5d
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body id="body" class="body">
7 <div class="parentSibling"></div>
8 <div class="parent">
9 <div id="sibling" class="sibling"></div>
10 <div id="rootNode" class="rootNode">
11 <div></div>
12 <div></div>
13 <div></div>
14 <div></div>
15 <div></div>
16 <div></div>
17 </div>
18 </div>
19 </body>
20 <script>
21 description('Test for crbug.com/304069: querySelectorAll regression.');
23 var rootNode = document.getElementById('rootNode');
24 shouldBe("rootNode.querySelectorAll('#body div').length", "6");
25 shouldBe("rootNode.querySelectorAll('#body').length", "0");
26 shouldBe("rootNode.querySelectorAll('div + #rootNode div').length", "6");
28 shouldBe("rootNode.querySelectorAll('.sibling + .rootNode div').length", "6");
29 shouldBe("rootNode.querySelectorAll('.sibling ~ .rootNode div').length", "6");
30 shouldBe("rootNode.querySelectorAll('.sibling .rootNode div').length", "0");
31 shouldBe("rootNode.querySelectorAll('.sibling div').length", "0");
32 shouldBe("rootNode.querySelectorAll('.body .rootNode div').length", "6");
33 shouldBe("rootNode.querySelectorAll('.body .sibling + .rootNode div').length", "6");
34 shouldBe("rootNode.querySelectorAll('.body .parentSibling + .parent div').length", "6");
35 shouldBe("rootNode.querySelectorAll('.body .parentSibling ~ .parent div').length", "6");
36 shouldBe("rootNode.querySelectorAll('.body div').length", "6");
37 shouldBe("rootNode.querySelectorAll('.body').length", "0");
39 shouldBe("rootNode.querySelectorAll('body div').length", "6");
40 shouldBe("rootNode.querySelectorAll('body').length", "0");
42 shouldBeNull("rootNode.querySelector('#body')");
43 shouldBeNull("rootNode.querySelector('.body')");
44 shouldBeNull("rootNode.querySelector('body')");
45 </script>
46 </html>