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

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

Issue 579253002: Change StyleResolver::document() to be private (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index e6eb2f31e3dbf4d9063f2e89c8b6c1a5cd3b876d..33e6717f4a3fd9e424274c26e0457b5e5853d71e 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -193,7 +193,19 @@ void StyleResolver::appendCSSStyleSheet(CSSStyleSheet* cssSheet)
ScopedStyleResolver& resolver = treeScope->ensureScopedStyleResolver();
document().styleEngine()->addScopedStyleResolver(&resolver);
- resolver.addRulesFromSheet(cssSheet, *m_medium, this);
+ unsigned index = resolver.appendCSSStyleSheet(cssSheet);
+
+ addRulesFromSheet(cssSheet, treeScope, index);
+}
+
+void StyleResolver::addRulesFromSheet(CSSStyleSheet* cssSheet, TreeScope* treeScope, unsigned index)
+{
+ StyleSheetContents* sheet = cssSheet->contents();
+ AddRuleFlags addRuleFlags = document().securityOrigin()->canRequest(sheet->baseURL()) ? RuleHasDocumentSecurityOrigin : RuleHasNoSpecialState;
+ const RuleSet& ruleSet = sheet->ensureRuleSet(*m_medium, addRuleFlags);
+
+ addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults());
+ processScopedRules(ruleSet, cssSheet, index, treeScope->rootNode());
}
void StyleResolver::appendPendingAuthorStyleSheets()
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698