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() |