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

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: 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..43425064d661d16029fe93ad92047df16e67ffba 100644
--- a/Source/core/css/RuleFeature.cpp
+++ b/Source/core/css/RuleFeature.cpp
@@ -109,13 +109,16 @@ bool RuleFeatureSet::updateClassInvalidationSets(const CSSSelector& selector)
AtomicString id;
AtomicString tagName;
- const CSSSelector* lastSelector = &selector;
- for (; lastSelector->relation() == CSSSelector::SubSelector; lastSelector = lastSelector->tagHistory()) {
- extractClassIdOrTag(*lastSelector, classes, id, tagName);
- }
- extractClassIdOrTag(*lastSelector, classes, id, tagName);
-
- for (const CSSSelector* current = &selector ; current; current = current->tagHistory()) {
+ bool rightmostCompoundSelector = true;
+ for (const CSSSelector* current = &selector; current; current = current->tagHistory()) {
+ if (rightmostCompoundSelector) {
+ extractClassIdOrTag(*current, classes, id, tagName);
+ if (current->m_match == CSSSelector::Class)
+ ensureClassInvalidationSet(current->value());
+ if (current->relation() != CSSSelector::SubSelector)
+ rightmostCompoundSelector = false;
+ continue;
esprehn 2014/02/21 04:33:46 I think you want to do this as two loops like befo
rune 2014/02/21 10:17:17 Done that now. I did a break on !SubSelector inste
+ }
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