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

Unified Diff: third_party/WebKit/Source/core/css/RuleFeature.cpp

Issue 2700943003: Invalidate custom pseudo elements for RuleSet invalidations. (Closed)
Patch Set: Created 3 years, 10 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: third_party/WebKit/Source/core/css/RuleFeature.cpp
diff --git a/third_party/WebKit/Source/core/css/RuleFeature.cpp b/third_party/WebKit/Source/core/css/RuleFeature.cpp
index ec4bba5004290332d40f28f73d7f983534890f93..9a9dffcd3b9eed39cc0ef63716ef29e6f14411ae 100644
--- a/third_party/WebKit/Source/core/css/RuleFeature.cpp
+++ b/third_party/WebKit/Source/core/css/RuleFeature.cpp
@@ -480,12 +480,23 @@ void RuleFeatureSet::updateInvalidationSets(const RuleData& ruleData) {
void RuleFeatureSet::updateRuleSetInvalidation(
const InvalidationSetFeatures& features) {
- if (!features.hasFeaturesForRuleSetInvalidation) {
- if (features.forceSubtree || features.tagNames.isEmpty())
- m_metadata.needsFullRecalcForRuleSetInvalidation = true;
- else
- addTagNamesToTypeRuleInvalidationSet(features.tagNames);
+ if (features.hasFeaturesForRuleSetInvalidation)
+ return;
+ if (features.forceSubtree ||
+ (!features.customPseudoElement && features.tagNames.isEmpty())) {
+ m_metadata.needsFullRecalcForRuleSetInvalidation = true;
+ return;
+ }
+
+ ensureTypeRuleInvalidationSet();
+
+ if (features.customPseudoElement) {
+ m_typeRuleInvalidationSet->setCustomPseudoInvalid();
+ m_typeRuleInvalidationSet->setTreeBoundaryCrossing();
}
+
+ for (auto tagName : features.tagNames)
+ m_typeRuleInvalidationSet->addTagName(tagName);
}
void RuleFeatureSet::updateInvalidationSetsForContentAttribute(
@@ -1167,14 +1178,6 @@ void RuleFeatureSet::addFeaturesToUniversalSiblingInvalidationSet(
descendantFeatures);
}
-void RuleFeatureSet::addTagNamesToTypeRuleInvalidationSet(
- const Vector<AtomicString>& tagNames) {
- DCHECK(!tagNames.isEmpty());
- ensureTypeRuleInvalidationSet();
- for (auto tagName : tagNames)
- m_typeRuleInvalidationSet->addTagName(tagName);
-}
-
DEFINE_TRACE(RuleFeatureSet) {
visitor->trace(m_siblingRules);
visitor->trace(m_uncommonAttributeRules);
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.h ('k') | third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698