Index: LayoutTests/fast/selectors/querySelector-leftmost-selector-matches-rootNode.html |
diff --git a/LayoutTests/fast/selectors/querySelector-leftmost-selector-matches-rootNode.html b/LayoutTests/fast/selectors/querySelector-leftmost-selector-matches-rootNode.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7ff558ad1a25ed69c17b462e5b370e7b92e55c53 |
--- /dev/null |
+++ b/LayoutTests/fast/selectors/querySelector-leftmost-selector-matches-rootNode.html |
@@ -0,0 +1,28 @@ |
+<!doctype html> |
+<html> |
+<head> |
+<script src="../js/resources/js-test-pre.js"></script> |
+</head> |
+<body id="target" class="target"> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <pre id='console'></pre> |
+</body> |
+<script> |
+description('Test for crbug.com/304069: querySelectorAll regression.'); |
+shouldBe("document.body.querySelectorAll('#target > div').length", "6"); |
+shouldBe("document.body.querySelectorAll('#target').length", "0"); |
+shouldBe("document.body.querySelectorAll('.target > div').length", "6"); |
+shouldBe("document.body.querySelectorAll('.target').length", "0"); |
+shouldBe("document.body.querySelectorAll('body > div').length", "6"); |
+shouldBe("document.body.querySelectorAll('body').length", "0"); |
+shouldBeNull("document.body.querySelector('#target')"); |
+shouldBeNull("document.body.querySelector('.target')"); |
+shouldBeNull("document.body.querySelector('body')"); |
+</script> |
+<script src="../js/resources/js-test-post.js"></script> |
+</html> |