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

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

Issue 639433002: Drop InvalidationSetMode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/RuleFeature.h
diff --git a/Source/core/css/RuleFeature.h b/Source/core/css/RuleFeature.h
index bed17a70747a06bfc5c895de386d0dab0fa318ba..ded4852affbabf932006c533f09be43ca2050c86 100644
--- a/Source/core/css/RuleFeature.h
+++ b/Source/core/css/RuleFeature.h
@@ -125,41 +125,48 @@ 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()
: customPseudoElement(false)
, treeBoundaryCrossing(false)
- , wholeSubtree(false)
+ , insertionPointCrossing(false)
+ , adjacent(false)
+ , hasFeatures(false)
{ }
+
+ void addClass(AtomicString className) { classes.append(className); hasFeatures = true; }
+ void addAttribute(AtomicString attribute) { attributes.append(attribute); hasFeatures = true; }
+ void setId(AtomicString idString) { id = idString; hasFeatures = true; }
+ void setTagName(AtomicString tag) { tagName = tag; hasFeatures = true; }
+ void setHasCustomPseudo() { customPseudoElement = true; hasFeatures = true; }
+
+ bool useSubtreeInvalidation() const { return !hasFeatures || adjacent; }
+
Vector<AtomicString> classes;
Vector<AtomicString> attributes;
AtomicString id;
AtomicString tagName;
+
bool customPseudoElement;
bool treeBoundaryCrossing;
- bool wholeSubtree;
+ bool insertionPointCrossing;
+ bool adjacent;
+ bool hasFeatures;
};
static void extractInvalidationSetFeature(const CSSSelector&, InvalidationSetFeatures&);
const CSSSelector* extractInvalidationSetFeatures(const CSSSelector&, InvalidationSetFeatures&, bool negated);
+
+ void addFeaturesToInvalidationSet(DescendantInvalidationSet&, const InvalidationSetFeatures&);
void addFeaturesToInvalidationSets(const CSSSelector&, InvalidationSetFeatures&);
void addClassToInvalidationSet(const AtomicString& className, Element&);

Powered by Google App Engine
This is Rietveld 408576698