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

Unified Diff: LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope.html

Issue 93863004: Regression(r164102): CSS Selector queries on duplicate ids match non-descendant elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope.html
diff --git a/LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope.html b/LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope.html
new file mode 100644
index 0000000000000000000000000000000000000000..408fab8ed492aa41a9da67b84dcebf66384d496f
--- /dev/null
+++ b/LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+ <span id="duplicateId1"></span>
+ <span id="duplicateId1"></span>
+ <span id="duplicateId2"></span>
+ <span id="duplicateId2"></span>
+ <div id="scopeDiv">
+ <span id="duplicateId1"></span>
+ <span id="duplicateId1"></span>
+ <span id="duplicateId1"></span>
+ <span id="duplicateId1"></span>
+ </div>
+ <script>
+ description("Test that CSS selector queries on duplicate Ids respect scope.");
+
+ shouldBe("document.querySelectorAll('#duplicateId1').length", "6");
+ shouldBe("document.querySelectorAll('#duplicateId2').length", "2");
+
+ scopeDiv = document.getElementById("scopeDiv");
+ shouldBe("scopeDiv.querySelectorAll('#duplicateId1').length", "4");
+ shouldBeNull("scopeDiv.querySelector('#duplicateId2')");
+ shouldBe("scopeDiv.querySelectorAll('#duplicateId2').length", "0");
+ </script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope-expected.txt » ('j') | Source/core/dom/SelectorQuery.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698