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

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

Issue 641583002: Rename wholeSubtree to adjacent. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review issue 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
« no previous file with comments | « Source/core/css/RuleFeature.h ('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 250988215f7eec346be477df3f55375af0de70d8..f7b0cf07045b63bb32b244c965f7ac91ecc4380f 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -263,21 +263,12 @@ const CSSSelector* RuleFeatureSet::extractInvalidationSetFeatures(const CSSSelec
}
}
- switch (current->relation()) {
- case CSSSelector::SubSelector:
- break;
- case CSSSelector::ShadowPseudo:
- case CSSSelector::ShadowDeep:
- features.treeBoundaryCrossing = true;
- return current->tagHistory();
- case CSSSelector::DirectAdjacent:
- case CSSSelector::IndirectAdjacent:
- features.wholeSubtree = true;
- return current->tagHistory();
- case CSSSelector::Descendant:
- case CSSSelector::Child:
- return current->tagHistory();
- }
+ if (current->relation() == CSSSelector::SubSelector)
+ continue;
+
+ features.treeBoundaryCrossing = current->isShadowSelector();
+ features.adjacent = current->isAdjacentSelector();
+ return current->tagHistory();
}
return 0;
}
@@ -291,7 +282,8 @@ const CSSSelector* RuleFeatureSet::extractInvalidationSetFeatures(const CSSSelec
// ContainerNode::checkForChildrenAdjacentRuleChanges.
//
// As we encounter a descendant type of combinator, the features only need to be checked
-// against descendants in the same subtree only. Hence wholeSubtree is reset to false.
+// against descendants in the same subtree only. features.adjacent is set to false, and
+// we start adding features instead of calling setWholeSubtreeInvalid.
void RuleFeatureSet::addFeaturesToInvalidationSets(const CSSSelector& selector, InvalidationSetFeatures& features)
{
@@ -299,7 +291,7 @@ void RuleFeatureSet::addFeaturesToInvalidationSets(const CSSSelector& selector,
if (DescendantInvalidationSet* invalidationSet = invalidationSetForSelector(*current)) {
if (features.treeBoundaryCrossing)
invalidationSet->setTreeBoundaryCrossing();
- if (features.wholeSubtree) {
+ if (features.adjacent) {
invalidationSet->setWholeSubtreeInvalid();
} else {
if (!features.id.isEmpty())
@@ -322,23 +314,12 @@ void RuleFeatureSet::addFeaturesToInvalidationSets(const CSSSelector& selector,
addFeaturesToInvalidationSets(*selector, features);
}
}
- switch (current->relation()) {
- case CSSSelector::SubSelector:
- break;
- case CSSSelector::ShadowPseudo:
- case CSSSelector::ShadowDeep:
+
+ if (current->isShadowSelector())
features.treeBoundaryCrossing = true;
- features.wholeSubtree = false;
- break;
- case CSSSelector::Descendant:
- case CSSSelector::Child:
- features.wholeSubtree = false;
- break;
- case CSSSelector::DirectAdjacent:
- case CSSSelector::IndirectAdjacent:
- features.wholeSubtree = true;
- break;
- }
+
+ if (current->relation() != CSSSelector::SubSelector)
+ features.adjacent = current->isAdjacentSelector();
}
}
« no previous file with comments | « Source/core/css/RuleFeature.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698