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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 2703643003: Schedule a type selector invalidation set for RuleSet invalidations. (Closed)
Patch Set: Corrected expectation text. Created 3 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
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();
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/dom/StyleEngineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698