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

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

Issue 684993007: Support style invalidation for ::cue selectors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Sort alphabetically 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
« no previous file with comments | « LayoutTests/media/track/cue-style-invalidation-expected.txt ('k') | no next file » | 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 2e7bceb023b0905bd5ef3370650ce2f6df02e402..ef6dc0b19af2cc8edf19f87c0131d506911934ec 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -138,6 +138,9 @@ static bool supportsInvalidation(CSSSelector::PseudoType type)
case CSSSelector::PseudoInRange:
case CSSSelector::PseudoOutOfRange:
case CSSSelector::PseudoWebKitCustomElement:
+ case CSSSelector::PseudoCue:
+ case CSSSelector::PseudoFutureCue:
+ case CSSSelector::PseudoPastCue:
case CSSSelector::PseudoUnresolved:
case CSSSelector::PseudoContent:
case CSSSelector::PseudoHost:
@@ -171,9 +174,6 @@ static bool requiresSubtreeInvalidation(const CSSSelector& selector)
switch (selector.pseudoType()) {
case CSSSelector::PseudoFirstLine:
case CSSSelector::PseudoFirstLetter:
- case CSSSelector::PseudoCue:
- case CSSSelector::PseudoFutureCue:
- case CSSSelector::PseudoPastCue:
case CSSSelector::PseudoSpatialNavigationFocus:
// FIXME: Most pseudo classes/elements above can be supported and moved
// to assertSupportedPseudo(). Move on a case-by-case basis. If they
@@ -200,6 +200,14 @@ void RuleFeature::trace(Visitor* visitor)
visitor->trace(rule);
}
+static bool supportsInvalidationWithSelectorList(CSSSelector::PseudoType pseudo)
+{
+ return pseudo == CSSSelector::PseudoAny
+ || pseudo == CSSSelector::PseudoCue
+ || pseudo == CSSSelector::PseudoHost
+ || pseudo == CSSSelector::PseudoNot;
+}
+
// This method is somewhat conservative in what it accepts.
RuleFeatureSet::InvalidationSetMode RuleFeatureSet::invalidationSetModeForSelector(const CSSSelector& selector)
{
@@ -214,9 +222,7 @@ RuleFeatureSet::InvalidationSetMode RuleFeatureSet::invalidationSetModeForSelect
// We have found an invalidation set feature in the rightmost compound selector.
foundIdent = true;
}
- } else if (component->pseudoType() == CSSSelector::PseudoNot
- || component->pseudoType() == CSSSelector::PseudoHost
- || component->pseudoType() == CSSSelector::PseudoAny) {
+ } else if (supportsInvalidationWithSelectorList(component->pseudoType())) {
if (const CSSSelectorList* selectorList = component->selectorList()) {
// Features inside :not() are not added to the feature set, so consider it a universal selector.
bool foundUniversal = component->pseudoType() == CSSSelector::PseudoNot;
@@ -343,7 +349,7 @@ const CSSSelector* RuleFeatureSet::extractInvalidationSetFeatures(const CSSSelec
extractInvalidationSetFeature(*current, features);
// Initialize the entry in the invalidation set map, if supported.
invalidationSetForSelector(*current);
- if (current->pseudoType() == CSSSelector::PseudoHost || current->pseudoType() == CSSSelector::PseudoAny || current->pseudoType() == CSSSelector::PseudoNot) {
+ if (supportsInvalidationWithSelectorList(current->pseudoType())) {
if (const CSSSelectorList* selectorList = current->selectorList()) {
for (const CSSSelector* selector = selectorList->first(); selector; selector = CSSSelectorList::next(*selector))
extractInvalidationSetFeatures(*selector, features, current->pseudoType() == CSSSelector::PseudoNot);
@@ -405,7 +411,7 @@ void RuleFeatureSet::addFeaturesToInvalidationSets(const CSSSelector& selector,
if (current->isInsertionPointCrossing())
features.insertionPointCrossing = true;
if (const CSSSelectorList* selectorList = current->selectorList()) {
- ASSERT(current->pseudoType() == CSSSelector::PseudoHost || current->pseudoType() == CSSSelector::PseudoAny || current->pseudoType() == CSSSelector::PseudoNot);
+ ASSERT(supportsInvalidationWithSelectorList(current->pseudoType()));
for (const CSSSelector* selector = selectorList->first(); selector; selector = CSSSelectorList::next(*selector))
addFeaturesToInvalidationSets(*selector, features);
}
« no previous file with comments | « LayoutTests/media/track/cue-style-invalidation-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698