4 <script src=
"../../resources/js-test.js"></script>
7 testRunner
.dumpAsText();
12 <li id='scope'
><a>abc
</a></li>
18 description('This test makes sure that :scope works correctly.');
20 var scope
= document
.getElementById('scope');
21 shouldBe('scope.querySelectorAll("ul a").length', '1');
22 shouldBe('scope.querySelector("ul a")', 'scope.firstChild');
23 shouldBe('scope.querySelectorAll(":scope ul a").length', '0');
24 shouldBeNull('scope.querySelector(":scope ul a")');
25 shouldBe('document.querySelectorAll(":scope ul a").length', '2');
26 shouldBe('document.querySelectorAll(":root ul a").length', '2');
28 shouldBe('document.querySelectorAll(":scope a").length', '2');
29 shouldBe('scope.querySelectorAll(":scope a").length', '1');
30 shouldBe('scope.querySelectorAll(":scope a").item(0)', 'scope.firstChild');
31 shouldBe('scope.querySelector(":scope a")', 'scope.querySelectorAll(":scope a").item(0)');