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

Unified Diff: Source/core/dom/shadow/SelectRuleFeatureSet.cpp

Issue 600223002: Minimal feature collector for select selectors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@select-features-20140924
Patch Set: Created 6 years, 3 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/dom/shadow/SelectRuleFeatureSet.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/shadow/SelectRuleFeatureSet.cpp
diff --git a/Source/core/dom/shadow/SelectRuleFeatureSet.cpp b/Source/core/dom/shadow/SelectRuleFeatureSet.cpp
index 23338960589a0e32cc2b31bf1bda67683d39220f..40a398e5502a2ce4fd096b8c6bf87f3b1b64045d 100644
--- a/Source/core/dom/shadow/SelectRuleFeatureSet.cpp
+++ b/Source/core/dom/shadow/SelectRuleFeatureSet.cpp
@@ -32,11 +32,26 @@
#include "core/dom/shadow/SelectRuleFeatureSet.h"
#include "core/css/CSSSelector.h"
+#include "core/css/CSSSelectorList.h"
#include "wtf/BitVector.h"
namespace blink {
+void SelectRuleFeatureSet::collectFeaturesFromSelector(const CSSSelector& selector)
+{
+ for (const CSSSelector* current = &selector; current; current = current->tagHistory()) {
+ if (invalidationSetForSelector(*current))
+ continue;
+
+ if (!current->selectorList())
+ continue;
+
+ for (const CSSSelector* selector = current->selectorList()->first(); selector; selector = CSSSelectorList::next(*selector))
+ collectFeaturesFromSelector(*selector);
+ }
+}
+
bool SelectRuleFeatureSet::checkSelectorsForClassChange(const SpaceSplitString& changedClasses) const
{
unsigned changedSize = changedClasses.size();
« no previous file with comments | « Source/core/dom/shadow/SelectRuleFeatureSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698