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

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

Issue 2880263002: Clear document scope dirtiness in import StyleEngine. (Closed)
Patch Set: Created 3 years, 7 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/StyleEngine.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
index 9a6c0f7ba95c94b94caad9d410460037562642b3..bf671333e975d391cfe623922caf6ceff93347f2 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -291,7 +291,7 @@ void StyleEngine::MediaQueryAffectingValueChanged() {
resolver_->UpdateMediaType();
}
-void StyleEngine::UpdateStyleSheetsInImport(
+void StyleEngine::UpdateActiveStyleSheetsInImport(
StyleEngine& master_engine,
DocumentStyleSheetCollector& parent_collector) {
DCHECK(!IsMaster());
@@ -301,6 +301,18 @@ void StyleEngine::UpdateStyleSheetsInImport(
GetDocumentStyleSheetCollection().CollectStyleSheets(master_engine,
subcollector);
GetDocumentStyleSheetCollection().SwapSheetsForSheetList(sheets_for_list);
+
+ // all_tree_scopes_dirty_ should only be set on main documents, never html
+ // imports.
+ DCHECK(!all_tree_scopes_dirty_);
+ // Make sure we don't re-collect sheets for style sheet list.
+ document_scope_dirty_ = false;
+ // Dirty tree scopes shadow trees do not affect the main document. Just leave
+ // them dirty here and re-collect when styleSheets is queried on shadow roots
+ // inside html import documents.
+ // tree_scopes_removed_ is irrelevant for html imports as the sheets do not
+ // affect style and removing a shadow tree is reflected directly in
+ // StyleSheetList accessing length or items.
}
void StyleEngine::UpdateActiveStyleSheetsInShadow(
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/web/tests/HTMLImportSheetsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698