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

Unified Diff: third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.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/ShadowTreeStyleSheetCollection.cpp
diff --git a/third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp b/third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp
index 7f735dd5d9bb6c537f8375d32dcbf24e20def2b5..179eb2c09e3b880371813305ca55c63b7e98c83b 100644
--- a/third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp
+++ b/third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp
@@ -47,6 +47,7 @@ ShadowTreeStyleSheetCollection::ShadowTreeStyleSheetCollection(
: TreeScopeStyleSheetCollection(shadowRoot) {}
void ShadowTreeStyleSheetCollection::collectStyleSheets(
+ StyleEngine& masterEngine,
StyleSheetCollection& collection) {
for (Node* n : m_styleSheetCandidateNodes) {
StyleSheetCandidate candidate(*n);
@@ -59,16 +60,17 @@ void ShadowTreeStyleSheetCollection::collectStyleSheets(
collection.appendSheetForList(sheet);
if (candidate.canBeActivated(nullAtom)) {
CSSStyleSheet* cssSheet = toCSSStyleSheet(sheet);
- collection.appendActiveStyleSheet(std::make_pair(
- cssSheet, document().styleEngine().ruleSetForSheet(*cssSheet)));
+ collection.appendActiveStyleSheet(
+ std::make_pair(cssSheet, masterEngine.ruleSetForSheet(*cssSheet)));
}
}
}
-void ShadowTreeStyleSheetCollection::updateActiveStyleSheets() {
+void ShadowTreeStyleSheetCollection::updateActiveStyleSheets(
+ StyleEngine& masterEngine) {
// StyleSheetCollection is GarbageCollected<>, allocate it on the heap.
StyleSheetCollection* collection = StyleSheetCollection::create();
- collectStyleSheets(*collection);
+ collectStyleSheets(masterEngine, *collection);
applyActiveStyleSheetChanges(*collection);
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.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