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

Unified Diff: Source/core/css/CSSSelectorList.cpp

Issue 1153873004: Handle ::content and :host-context correctly in SelectorQuery. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test naming. Created 5 years, 7 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: Source/core/css/CSSSelectorList.cpp
diff --git a/Source/core/css/CSSSelectorList.cpp b/Source/core/css/CSSSelectorList.cpp
index ab96e144bb2752f258cf5f603d34143ed0d1ac1c..b51944e7877d077ba2b712c9119d9f12442ed6c6 100644
--- a/Source/core/css/CSSSelectorList.cpp
+++ b/Source/core/css/CSSSelectorList.cpp
@@ -195,4 +195,18 @@ bool CSSSelectorList::selectorCrossesTreeScopes(size_t index) const
return forEachTagSelector(functor, selectorAt(index));
}
+class SelectorNeedsUpdatedDistribution {
+public:
+ bool operator()(const CSSSelector& selector)
+ {
+ return selector.relationIsAffectedByPseudoContent() || selector.pseudoType() == CSSSelector::PseudoHostContext;
+ }
+};
+
+bool CSSSelectorList::selectorNeedsUpdatedDistribution(size_t index) const
+{
+ SelectorNeedsUpdatedDistribution functor;
+ return forEachTagSelector(functor, selectorAt(index));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698