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

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

Issue 42543007: StyleResolver should update RuleSets lazily. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Filter @viewport and @font-face in lazyAppend Created 7 years, 1 month 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: Source/core/css/resolver/ScopedStyleResolver.cpp
diff --git a/Source/core/css/resolver/ScopedStyleResolver.cpp b/Source/core/css/resolver/ScopedStyleResolver.cpp
index 0f065421841a05477419d606e54601b4c1dd3ee9..7af7b89ed139987a8d67e6bd6177704f2bd309b5 100644
--- a/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -246,11 +246,21 @@ const ContainerNode* ScopedStyleResolver::scopingNodeFor(const CSSStyleSheet* sh
return (parent->isElementNode() || parent->isShadowRoot()) ? parent : 0;
}
-void ScopedStyleResolver::addRulesFromSheet(StyleSheetContents* sheet, const MediaQueryEvaluator& medium, StyleResolver* resolver)
+inline RuleSet* ScopedStyleResolver::ensureAuthorStyle()
{
if (!m_authorStyle)
m_authorStyle = RuleSet::create();
- m_authorStyle->addRulesFromSheet(sheet, medium, resolver, &m_scopingNode);
+ return m_authorStyle.get();
+}
+
+void ScopedStyleResolver::addRulesFromSheet(StyleSheetContents* sheet, const MediaQueryEvaluator& medium, StyleResolver* resolver, bool processFontFaceAndViewportRule)
+{
+ ensureAuthorStyle()->addRulesFromSheet(sheet, medium, resolver, &m_scopingNode, processFontFaceAndViewportRule);
+}
+
+void ScopedStyleResolver::addViewportRule(StyleRuleViewport* rule)
+{
+ ensureAuthorStyle()->addViewportRule(rule);
}
inline RuleSet* ScopedStyleResolver::ensureAtHostRuleSetFor(const ShadowRoot* shadowRoot)

Powered by Google App Engine
This is Rietveld 408576698