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()) |