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

Unified Diff: third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 2394353003: Apply RuleSet changes for active stylesheet changes. (Closed)
Patch Set: Created 4 years, 2 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/css/resolver/ScopedStyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
index e9d24f67be7df7bd283394b81c420509bb6d7a7e..802eb67ae640a0e6343f1e4b116bd823a33d30e5 100644
--- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -103,6 +103,22 @@ void ScopedStyleResolver::appendCSSStyleSheet(
ruleSet.deviceDependentMediaQueryResults());
}
+void ScopedStyleResolver::appendActiveStyleSheets(
+ unsigned index,
+ const ActiveStyleSheetVector& activeSheets) {
+ for (auto activeIterator = activeSheets.begin() + index;
+ activeIterator != activeSheets.end(); activeIterator++) {
+ CSSStyleSheet* sheet = activeIterator->first;
+ if (!activeIterator->second)
+ continue;
+ const RuleSet& ruleSet = *activeIterator->second;
+ m_authorStyleSheets.append(sheet);
+ addKeyframeRules(ruleSet);
+ addFontFaceRules(ruleSet);
+ addTreeBoundaryCrossingRules(ruleSet, sheet, index++);
+ }
+}
+
void ScopedStyleResolver::collectFeaturesTo(
RuleFeatureSet& features,
HeapHashSet<Member<const StyleSheetContents>>&
@@ -155,7 +171,8 @@ void ScopedStyleResolver::addKeyframeStyle(StyleRuleKeyframes* rule) {
}
}
-static Node& invalidationRootFor(const TreeScope& treeScope) {
+ContainerNode& ScopedStyleResolver::invalidationRootForTreeScope(
+ const TreeScope& treeScope) {
if (treeScope.rootNode() == treeScope.document())
return treeScope.document();
return toShadowRoot(treeScope.rootNode()).host();
@@ -188,7 +205,7 @@ void ScopedStyleResolver::keyframesRulesAdded(const TreeScope& treeScope) {
// rules were found for the animation-name, we need to recalculate style
// for the elements in the scope, including its shadow host if
// applicable.
- invalidationRootFor(treeScope).setNeedsStyleRecalc(
+ invalidationRootForTreeScope(treeScope).setNeedsStyleRecalc(
SubtreeStyleChange, StyleChangeReasonForTracing::create(
StyleChangeReason::StyleSheetChange));
return;
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.h ('k') | third_party/WebKit/Source/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698