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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 285
286 void StyleEngine::MediaQueryAffectingValueChanged() { 286 void StyleEngine::MediaQueryAffectingValueChanged() {
287 if (GetDocumentStyleSheetCollection().MediaQueryAffectingValueChanged()) 287 if (GetDocumentStyleSheetCollection().MediaQueryAffectingValueChanged())
288 SetNeedsActiveStyleUpdate(GetDocument()); 288 SetNeedsActiveStyleUpdate(GetDocument());
289 MediaQueryAffectingValueChanged(active_tree_scopes_); 289 MediaQueryAffectingValueChanged(active_tree_scopes_);
290 if (resolver_) 290 if (resolver_)
291 resolver_->UpdateMediaType(); 291 resolver_->UpdateMediaType();
292 } 292 }
293 293
294 void StyleEngine::UpdateStyleSheetsInImport( 294 void StyleEngine::UpdateActiveStyleSheetsInImport(
295 StyleEngine& master_engine, 295 StyleEngine& master_engine,
296 DocumentStyleSheetCollector& parent_collector) { 296 DocumentStyleSheetCollector& parent_collector) {
297 DCHECK(!IsMaster()); 297 DCHECK(!IsMaster());
298 HeapVector<Member<StyleSheet>> sheets_for_list; 298 HeapVector<Member<StyleSheet>> sheets_for_list;
299 ImportedDocumentStyleSheetCollector subcollector(parent_collector, 299 ImportedDocumentStyleSheetCollector subcollector(parent_collector,
300 sheets_for_list); 300 sheets_for_list);
301 GetDocumentStyleSheetCollection().CollectStyleSheets(master_engine, 301 GetDocumentStyleSheetCollection().CollectStyleSheets(master_engine,
302 subcollector); 302 subcollector);
303 GetDocumentStyleSheetCollection().SwapSheetsForSheetList(sheets_for_list); 303 GetDocumentStyleSheetCollection().SwapSheetsForSheetList(sheets_for_list);
304
305 // all_tree_scopes_dirty_ should only be set on main documents, never html
306 // imports.
307 DCHECK(!all_tree_scopes_dirty_);
308 // Make sure we don't re-collect sheets for style sheet list.
309 document_scope_dirty_ = false;
310 // Dirty tree scopes shadow trees do not affect the main document. Just leave
311 // them dirty here and re-collect when styleSheets is queried on shadow roots
312 // inside html import documents.
313 // tree_scopes_removed_ is irrelevant for html imports as the sheets do not
314 // affect style and removing a shadow tree is reflected directly in
315 // StyleSheetList accessing length or items.
304 } 316 }
305 317
306 void StyleEngine::UpdateActiveStyleSheetsInShadow( 318 void StyleEngine::UpdateActiveStyleSheetsInShadow(
307 TreeScope* tree_scope, 319 TreeScope* tree_scope,
308 UnorderedTreeScopeSet& tree_scopes_removed) { 320 UnorderedTreeScopeSet& tree_scopes_removed) {
309 DCHECK_NE(tree_scope, document_); 321 DCHECK_NE(tree_scope, document_);
310 ShadowTreeStyleSheetCollection* collection = 322 ShadowTreeStyleSheetCollection* collection =
311 ToShadowTreeStyleSheetCollection(StyleSheetCollectionFor(*tree_scope)); 323 ToShadowTreeStyleSheetCollection(StyleSheetCollectionFor(*tree_scope));
312 DCHECK(collection); 324 DCHECK(collection);
313 collection->UpdateActiveStyleSheets(*this); 325 collection->UpdateActiveStyleSheets(*this);
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 } 1208 }
1197 1209
1198 DEFINE_TRACE_WRAPPERS(StyleEngine) { 1210 DEFINE_TRACE_WRAPPERS(StyleEngine) {
1199 for (auto sheet : injected_author_style_sheets_) { 1211 for (auto sheet : injected_author_style_sheets_) {
1200 visitor->TraceWrappers(sheet); 1212 visitor->TraceWrappers(sheet);
1201 } 1213 }
1202 visitor->TraceWrappers(document_style_sheet_collection_); 1214 visitor->TraceWrappers(document_style_sheet_collection_);
1203 } 1215 }
1204 1216
1205 } // namespace blink 1217 } // namespace blink
OLDNEW
« 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