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

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

Issue 174013010: Make selector list pseudos work with class invalidation sets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More readable colors. Created 6 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
« no previous file with comments | « LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo-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 0d8cdffee98749c87216d7ebdc30b7e959a2cc89..800420dff1db91fd3ded89bd6b1f3a5e888b5398 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -48,12 +48,58 @@ namespace WebCore {
static bool isSkippableComponentForInvalidation(const CSSSelector& selector)
{
- if (selector.matchesPseudoElement() || selector.pseudoType() == CSSSelector::PseudoHost)
+ if (selector.m_match == CSSSelector::Tag
+ || selector.m_match == CSSSelector::Id
+ || selector.isAttributeSelector())
+ return true;
+ if (selector.m_match != CSSSelector::PseudoClass)
return false;
- return true;
+ switch (selector.pseudoType()) {
+ case CSSSelector::PseudoEmpty:
+ case CSSSelector::PseudoFirstChild:
+ case CSSSelector::PseudoFirstOfType:
+ case CSSSelector::PseudoLastChild:
+ case CSSSelector::PseudoLastOfType:
+ case CSSSelector::PseudoOnlyChild:
+ case CSSSelector::PseudoOnlyOfType:
+ case CSSSelector::PseudoNthChild:
+ case CSSSelector::PseudoNthOfType:
+ case CSSSelector::PseudoNthLastChild:
+ case CSSSelector::PseudoNthLastOfType:
+ case CSSSelector::PseudoLink:
+ case CSSSelector::PseudoVisited:
+ case CSSSelector::PseudoAnyLink:
+ case CSSSelector::PseudoHover:
+ case CSSSelector::PseudoDrag:
+ case CSSSelector::PseudoFocus:
+ case CSSSelector::PseudoActive:
+ case CSSSelector::PseudoChecked:
+ case CSSSelector::PseudoEnabled:
+ case CSSSelector::PseudoDefault:
+ case CSSSelector::PseudoDisabled:
+ case CSSSelector::PseudoOptional:
+ case CSSSelector::PseudoRequired:
+ case CSSSelector::PseudoReadOnly:
+ case CSSSelector::PseudoReadWrite:
+ case CSSSelector::PseudoValid:
+ case CSSSelector::PseudoInvalid:
+ case CSSSelector::PseudoIndeterminate:
+ case CSSSelector::PseudoTarget:
+ case CSSSelector::PseudoLang:
+ case CSSSelector::PseudoRoot:
+ case CSSSelector::PseudoScope:
+ case CSSSelector::PseudoInRange:
+ case CSSSelector::PseudoOutOfRange:
+ case CSSSelector::PseudoUnresolved:
+ return true;
+ default:
+ return false;
+ }
+ ASSERT_NOT_REACHED();
+ return false;
}
-// This method is somewhat conservative in what it acceptss.
+// This method is somewhat conservative in what it accepts.
static bool supportsClassDescendantInvalidation(const CSSSelector& selector)
{
bool foundDescendantRelation = false;
« no previous file with comments | « LayoutTests/fast/css/invalidation/dynamic-selector-list-pseudo-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698