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

Unified Diff: Source/core/dom/SelectorQuery.cpp

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
« no previous file with comments | « LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/SelectorQuery.cpp
diff --git a/Source/core/dom/SelectorQuery.cpp b/Source/core/dom/SelectorQuery.cpp
index bfaa3715f43f280e24deba2e43f464b699e7dfdb..8f9f4a4e6d79c1b5d2b9188a81afc4b595d38392 100644
--- a/Source/core/dom/SelectorQuery.cpp
+++ b/Source/core/dom/SelectorQuery.cpp
@@ -337,6 +337,8 @@ void SelectorDataList::executeQueryAll(Node& rootNode, Vector<RefPtr<Node> >& ma
for (size_t i = 0; i < count; ++i) {
Element* element = elements[i];
ASSERT(element);
+ if (!(isTreeScopeRoot(rootNode) || element->isDescendantOf(&rootNode)))
+ continue;
if (selectorMatches(selector, *element, rootNode))
matchedElements.append(element);
}
@@ -463,6 +465,8 @@ Element* SelectorDataList::executeQueryFirst(Node& rootNode) const
for (size_t i = 0; i < count; ++i) {
Element* element = elements[i];
ASSERT(element);
+ if (!(isTreeScopeRoot(rootNode) || element->isDescendantOf(&rootNode)))
Inactive 2014/01/05 20:46:33 FYI, I am planning on working on getting rid of th
+ continue;
if (selectorMatches(selector, *element, rootNode))
return element;
}
« no previous file with comments | « LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698