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

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

Issue 2284633002: Allow multiple type and id selectors in invalidation set features. (Closed)
Patch Set: Unit tests Created 4 years, 4 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 536bf1270918949f338e2a692e5eb50200eb9866..8ba872b147dd812063caee2a940108d165509c56 100644
--- a/third_party/WebKit/Source/core/css/RuleFeature.cpp
+++ b/third_party/WebKit/Source/core/css/RuleFeature.cpp
@@ -297,11 +297,11 @@ ALWAYS_INLINE InvalidationSet& RuleFeatureSet::ensurePseudoInvalidationSet(CSSSe
bool RuleFeatureSet::extractInvalidationSetFeature(const CSSSelector& selector, InvalidationSetFeatures& features)
{
if (selector.match() == CSSSelector::Tag && selector.tagQName().localName() != starAtom) {
- features.tagName = selector.tagQName().localName();
+ features.tagNames.append(selector.tagQName().localName());
return true;
}
if (selector.match() == CSSSelector::Id) {
- features.id = selector.value();
+ features.ids.append(selector.value());
return true;
}
if (selector.match() == CSSSelector::Class) {
@@ -526,10 +526,10 @@ void RuleFeatureSet::addFeaturesToInvalidationSet(InvalidationSet& invalidationS
if (features.contentPseudoCrossing || features.forceSubtree)
return;
- if (!features.id.isEmpty())
- invalidationSet.addId(features.id);
- if (!features.tagName.isEmpty())
- invalidationSet.addTagName(features.tagName);
+ for (const auto& id : features.ids)
+ invalidationSet.addId(id);
+ for (const auto& tagName : features.tagNames)
+ invalidationSet.addTagName(tagName);
for (const auto& className : features.classes)
invalidationSet.addClass(className);
for (const auto& attribute : features.attributes)
« 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