Index: third_party/WebKit/Source/core/dom/StyleEngine.cpp |
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp |
index 19826f40af5ae0c3d3799d4cb5d02e72990ddc6e..75ef6439682fd73f348554b875df3b81aabd9ae2 100644 |
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp |
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp |
@@ -832,15 +832,21 @@ void StyleEngine::scheduleRuleSetInvalidationsForElement( |
for (const Attribute& attribute : element.attributes()) |
ruleSet->features().collectInvalidationSetsForAttribute( |
invalidationLists, element, attribute.name()); |
- if (ruleSet->tagRules(element.localNameForSelectorMatching())) |
- element.setNeedsStyleRecalc(LocalStyleChange, |
- StyleChangeReasonForTracing::create( |
- StyleChangeReason::StyleSheetChange)); |
} |
m_styleInvalidator.scheduleInvalidationSetsForNode(invalidationLists, |
element); |
} |
+void StyleEngine::scheduleTypeRuleSetInvalidations( |
+ ContainerNode& node, |
+ const HeapHashSet<Member<RuleSet>>& ruleSets) { |
+ InvalidationLists invalidationLists; |
+ for (const auto& ruleSet : ruleSets) |
+ ruleSet->features().collectTypeRuleInvalidationSet(invalidationLists, node); |
+ DCHECK(invalidationLists.siblings.isEmpty()); |
+ m_styleInvalidator.scheduleInvalidationSetsForNode(invalidationLists, node); |
+} |
+ |
void StyleEngine::invalidateSlottedElements(HTMLSlotElement& slot) { |
for (auto& node : slot.getDistributedNodes()) { |
if (node->isElementNode()) |
@@ -863,6 +869,8 @@ void StyleEngine::scheduleInvalidationsForRuleSets( |
TRACE_EVENT0("blink,blink_style", |
"StyleEngine::scheduleInvalidationsForRuleSets"); |
+ scheduleTypeRuleSetInvalidations(treeScope.rootNode(), ruleSets); |
+ |
bool invalidateSlotted = false; |
if (treeScope.rootNode().isShadowRoot()) { |
Element& host = toShadowRoot(treeScope.rootNode()).host(); |