blob: dceed46e979d9e8a3ad1858611bcbe76905c0328 [file] [log] [blame]
<!doctype html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<ul>
<li id='scope'><a>abc</a></li>
<li>def</li>
<li><a>efg</a></li>
</ul>
</body>
<script>
description('This test makes sure that :scope with id filter works correctly.');
var scope = document.getElementById('scope');
shouldBe('scope.parentNode.querySelectorAll(":scope #scope a").item(0)', 'scope.firstChild');
shouldBe('scope.parentNode.querySelectorAll(":scope #scope a").length', '1');
shouldBe('scope.querySelectorAll(":scope #scope a").length', '0');
shouldBe('scope.parentNode.querySelectorAll(":scope #scope + li").length', '1');
shouldBe('scope.parentNode.querySelectorAll(":scope #scope + li").item(0)', 'scope.parentNode.children[1]');
shouldBe('document.querySelectorAll(":scope #scope a").item(0)', 'scope.firstChild');
</script>
<script src="../../resources/js-test-post.js"></script>
</html>