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

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

Issue 219193004: Custom pseudo element types as an invalidation set feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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/css/RuleFeature.h ('k') | Source/core/css/invalidation/DescendantInvalidationSet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/RuleFeature.cpp
diff --git a/Source/core/css/RuleFeature.cpp b/Source/core/css/RuleFeature.cpp
index f8ce8dd99902cd8455f5b19516311ed85ed56980..416628c1afcad95df5c35e8a750f9e3267d3b4c6 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -54,7 +54,7 @@ static bool isSkippableComponentForInvalidation(const CSSSelector& selector)
case CSSSelector::PseudoShadow:
return true;
default:
- return false;
+ return selector.isCustomPseudoElement();
}
}
if (selector.m_match != CSSSelector::PseudoClass)
@@ -110,7 +110,7 @@ RuleFeatureSet::InvalidationSetMode RuleFeatureSet::supportsClassDescendantInval
for (const CSSSelector* component = &selector; component; component = component->tagHistory()) {
// FIXME: next up: Tag and Id.
esprehn 2014/04/01 08:23:29 You should remove this comment, we support tags an
rune 2014/04/01 08:41:34 No, we don't. We need to add them to the if-test b
- if (component->m_match == CSSSelector::Class || component->isAttributeSelector()) {
+ if (component->m_match == CSSSelector::Class || component->isAttributeSelector() || component->isCustomPseudoElement()) {
if (!foundDescendantRelation)
foundIdent = true;
} else if (component->pseudoType() == CSSSelector::PseudoHost || component->pseudoType() == CSSSelector::PseudoAny) {
@@ -152,6 +152,8 @@ void RuleFeatureSet::extractInvalidationSetFeature(const CSSSelector& selector,
features.classes.append(selector.value());
else if (selector.isAttributeSelector())
features.attributes.append(selector.attribute().localName());
+ else if (selector.isCustomPseudoElement())
+ features.customPseudoElement = true;
}
RuleFeatureSet::RuleFeatureSet()
@@ -216,6 +218,8 @@ void RuleFeatureSet::addFeaturesToInvalidationSets(const CSSSelector& selector,
invalidationSet->addClass(*it);
for (Vector<AtomicString>::const_iterator it = features.attributes.begin(); it != features.attributes.end(); ++it)
invalidationSet->addAttribute(*it);
+ if (features.customPseudoElement)
+ invalidationSet->setCustomPseudoInvalid();
} else if (current->pseudoType() == CSSSelector::PseudoHost || current->pseudoType() == CSSSelector::PseudoAny) {
if (const CSSSelectorList* selectorList = current->selectorList()) {
for (const CSSSelector* selector = selectorList->first(); selector; selector = CSSSelectorList::next(*selector))
« no previous file with comments | « Source/core/css/RuleFeature.h ('k') | Source/core/css/invalidation/DescendantInvalidationSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698