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

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

Issue 1245933002: document.querySelector[All]() should check selector context (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 4 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 | « Source/core/css/SelectorChecker.cpp ('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 572180d2523e2f0ed1b15c571d590ccf27ae2a36..ee10ce8e35b7d8eb8c4a6d3adf16a3a95c28af74 100644
--- a/Source/core/dom/SelectorQuery.cpp
+++ b/Source/core/dom/SelectorQuery.cpp
@@ -122,9 +122,8 @@ inline bool SelectorDataList::selectorMatches(const CSSSelector& selector, Eleme
SelectorChecker selectorChecker(SelectorChecker::QueryingRules);
SelectorChecker::SelectorCheckingContext selectorCheckingContext(&element, SelectorChecker::VisitedMatchDisabled);
selectorCheckingContext.selector = &selector;
- selectorCheckingContext.scope = !rootNode.isDocumentNode() ? &rootNode : nullptr;
- if (selectorCheckingContext.scope)
- selectorCheckingContext.scopeContainsLastMatchedElement = true;
+ selectorCheckingContext.scope = &rootNode;
+ selectorCheckingContext.scopeContainsLastMatchedElement = true;
esprehn 2015/08/29 23:55:30 Why do we need scopeContainsLastMatchedElement at
return selectorChecker.match(selectorCheckingContext);
}
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698