| 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 6a5d1cee16dcd80a5e82f980cc0b12abbbd8b548..6e45ea566bc69d899b8ce3824dfbc8432eb114c6 100644
|
| --- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
|
| @@ -820,27 +820,39 @@ void StyleEngine::scheduleRuleSetInvalidationsForElement(
|
|
|
| InvalidationLists invalidationLists;
|
| for (const auto& ruleSet : ruleSets) {
|
| - if (!id.isNull())
|
| - ruleSet->features().collectInvalidationSetsForId(invalidationLists,
|
| - element, id);
|
| + if (!id.isNull()) {
|
| + ruleSet->features().collectInvalidationSetsForId(
|
| + invalidationLists, element, id,
|
| + RuleFeatureSet::InvalidationSetFilter::RuleSetInvalidation);
|
| + }
|
| if (classNames) {
|
| unsigned classNameCount = classNames->size();
|
| - for (size_t i = 0; i < classNameCount; i++)
|
| + for (size_t i = 0; i < classNameCount; i++) {
|
| ruleSet->features().collectInvalidationSetsForClass(
|
| - invalidationLists, element, (*classNames)[i]);
|
| + invalidationLists, element, (*classNames)[i],
|
| + RuleFeatureSet::InvalidationSetFilter::RuleSetInvalidation);
|
| + }
|
| }
|
| - for (const Attribute& attribute : element.attributes())
|
| + 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));
|
| + invalidationLists, element, attribute.name(),
|
| + RuleFeatureSet::InvalidationSetFilter::RuleSetInvalidation);
|
| + }
|
| }
|
| 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 +875,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();
|
|
|