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

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

Issue 2618803002: Use master StyleEngine to evaluate MQ in html imports. (Closed)
Patch Set: preferred sheet change broke a test Created 3 years, 11 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/DocumentStyleSheetCollection.cpp
diff --git a/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp
index 1bd5732603c926dac2a58fbee5ecf11a67fefc69..0297bca09d53892c10c35cd694795ce7526d5ae7 100644
--- a/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp
+++ b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp
@@ -45,6 +45,7 @@ DocumentStyleSheetCollection::DocumentStyleSheetCollection(TreeScope& treeScope)
}
void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(
+ StyleEngine& masterEngine,
DocumentStyleSheetCollector& collector) {
for (Node* n : m_styleSheetCandidateNodes) {
StyleSheetCandidate candidate(*n);
@@ -57,7 +58,9 @@ void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(
if (collector.hasVisited(document))
continue;
collector.willVisit(document);
- document->styleEngine().updateStyleSheetsInImport(collector);
+
+ document->styleEngine().updateStyleSheetsInImport(masterEngine,
+ collector);
continue;
}
@@ -74,18 +77,19 @@ void DocumentStyleSheetCollection::collectStyleSheetsFromCandidates(
continue;
CSSStyleSheet* cssSheet = toCSSStyleSheet(sheet);
- collector.appendActiveStyleSheet(std::make_pair(
- cssSheet, document().styleEngine().ruleSetForSheet(*cssSheet)));
+ collector.appendActiveStyleSheet(
+ std::make_pair(cssSheet, masterEngine.ruleSetForSheet(*cssSheet)));
}
}
void DocumentStyleSheetCollection::collectStyleSheets(
+ StyleEngine& masterEngine,
DocumentStyleSheetCollector& collector) {
for (auto& sheet : document().styleEngine().injectedAuthorStyleSheets()) {
collector.appendActiveStyleSheet(std::make_pair(
sheet, document().styleEngine().ruleSetForSheet(*sheet)));
}
- collectStyleSheetsFromCandidates(collector);
+ collectStyleSheetsFromCandidates(masterEngine, collector);
if (CSSStyleSheet* inspectorSheet =
document().styleEngine().inspectorStyleSheet()) {
collector.appendActiveStyleSheet(std::make_pair(
@@ -94,11 +98,12 @@ void DocumentStyleSheetCollection::collectStyleSheets(
}
}
-void DocumentStyleSheetCollection::updateActiveStyleSheets() {
+void DocumentStyleSheetCollection::updateActiveStyleSheets(
+ StyleEngine& masterEngine) {
// StyleSheetCollection is GarbageCollected<>, allocate it on the heap.
StyleSheetCollection* collection = StyleSheetCollection::create();
ActiveDocumentStyleSheetCollector collector(*collection);
- collectStyleSheets(collector);
+ collectStyleSheets(masterEngine, collector);
applyActiveStyleSheetChanges(*collection);
}

Powered by Google App Engine
This is Rietveld 408576698