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

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

Issue 171513013: Do not add features to classes in rightmost compound selector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Back to using two loops. 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/virtual/targetedstylerecalc/fast/css/invalidation/targeted-class-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 0d8cdffee98749c87216d7ebdc30b7e959a2cc89..9ef2deeaae025c6f8f4148a50a8c5bf65d1c9983 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -110,12 +110,18 @@ bool RuleFeatureSet::updateClassInvalidationSets(const CSSSelector& selector)
AtomicString tagName;
const CSSSelector* lastSelector = &selector;
- for (; lastSelector->relation() == CSSSelector::SubSelector; lastSelector = lastSelector->tagHistory()) {
+ for (; lastSelector; lastSelector = lastSelector->tagHistory()) {
extractClassIdOrTag(*lastSelector, classes, id, tagName);
+ if (lastSelector->m_match == CSSSelector::Class)
+ ensureClassInvalidationSet(lastSelector->value());
+ if (lastSelector->relation() != CSSSelector::SubSelector)
+ break;
}
- extractClassIdOrTag(*lastSelector, classes, id, tagName);
- for (const CSSSelector* current = &selector ; current; current = current->tagHistory()) {
+ if (!lastSelector)
+ return true;
+
+ for (const CSSSelector* current = lastSelector->tagHistory(); current; current = current->tagHistory()) {
if (current->m_match == CSSSelector::Class) {
DescendantInvalidationSet& invalidationSet = ensureClassInvalidationSet(current->value());
if (!id.isEmpty())
« no previous file with comments | « LayoutTests/virtual/targetedstylerecalc/fast/css/invalidation/targeted-class-style-invalidation-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698