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

Unified Diff: Source/core/css/RuleFeature.h

Issue 726503003: Single code path for updating invalidation sets. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Assertion fail, missing HostContext Created 6 years, 1 month 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/RuleFeature.h
diff --git a/Source/core/css/RuleFeature.h b/Source/core/css/RuleFeature.h
index b29330ddc23634820c7eda2b1a691f457d49e51d..1726a4148f60a53df7be2f37382445b48a63316f 100644
--- a/Source/core/css/RuleFeature.h
+++ b/Source/core/css/RuleFeature.h
@@ -125,23 +125,14 @@ private:
unsigned maxDirectAdjacentSelectors;
};
- enum InvalidationSetMode {
- AddFeatures,
- UseLocalStyleChange,
- UseSubtreeStyleChange
- };
-
- static InvalidationSetMode invalidationSetModeForSelector(const CSSSelector&);
-
- void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&, InvalidationSetMode);
- void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata&, InvalidationSetMode);
+ void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&);
DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& className);
DescendantInvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attributeName);
DescendantInvalidationSet& ensureIdInvalidationSet(const AtomicString& attributeName);
DescendantInvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType);
- InvalidationSetMode updateInvalidationSets(const CSSSelector&);
+ void updateInvalidationSets(const CSSSelector&);
struct InvalidationSetFeatures {
InvalidationSetFeatures()
@@ -149,7 +140,11 @@ private:
, treeBoundaryCrossing(false)
, adjacent(false)
, insertionPointCrossing(false)
+ , forceSubtree(false)
{ }
+
+ bool useSubtreeInvalidation() const { return forceSubtree || adjacent; }
+
Vector<AtomicString> classes;
Vector<AtomicString> attributes;
AtomicString id;
@@ -158,10 +153,14 @@ private:
bool treeBoundaryCrossing;
bool adjacent;
bool insertionPointCrossing;
+ bool forceSubtree;
};
- static void extractInvalidationSetFeature(const CSSSelector&, InvalidationSetFeatures&);
- const CSSSelector* extractInvalidationSetFeatures(const CSSSelector&, InvalidationSetFeatures&, bool negated);
+ static bool extractInvalidationSetFeature(const CSSSelector&, InvalidationSetFeatures&);
+
+ enum UseFeaturesType { UseFeatures, ForceSubtree };
+
+ std::pair<const CSSSelector*, UseFeaturesType> extractInvalidationSetFeatures(const CSSSelector&, InvalidationSetFeatures&, bool negated);
void addFeaturesToInvalidationSet(DescendantInvalidationSet&, const InvalidationSetFeatures&);
void addFeaturesToInvalidationSets(const CSSSelector&, InvalidationSetFeatures&);

Powered by Google App Engine
This is Rietveld 408576698