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

Unified Diff: sky/engine/core/dom/DocumentStyleSheetCollection.cpp

Issue 774953002: Always Reconstruct when stylesheets change. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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: sky/engine/core/dom/DocumentStyleSheetCollection.cpp
diff --git a/sky/engine/core/dom/DocumentStyleSheetCollection.cpp b/sky/engine/core/dom/DocumentStyleSheetCollection.cpp
index 8e974f8a4f34afd0a6a1db484a8008dc691f11ef..2e18aa0afe22cf82a0b36b90d1970d459c4d0272 100644
--- a/sky/engine/core/dom/DocumentStyleSheetCollection.cpp
+++ b/sky/engine/core/dom/DocumentStyleSheetCollection.cpp
@@ -67,33 +67,20 @@ void DocumentStyleSheetCollection::collectStyleSheets(StyleEngine* engine, Docum
collectStyleSheetsFromCandidates(engine, collector);
}
-void DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine, StyleResolverUpdateMode updateMode)
+void DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine)
{
StyleSheetCollection collection;
ActiveDocumentStyleSheetCollector collector(collection);
collectStyleSheets(engine, collector);
- StyleSheetChange change;
- analyzeStyleSheetChange(updateMode, collection, change);
+ engine->clearMasterResolver();
+ // FIMXE: The following depends on whether StyleRuleFontFace was modified or not.
+ // No need to always-clear font cache.
+ engine->clearFontCache();
- if (change.styleResolverUpdateType == Reconstruct) {
- engine->clearMasterResolver();
- // FIMXE: The following depends on whether StyleRuleFontFace was modified or not.
- // No need to always-clear font cache.
- engine->clearFontCache();
- } else if (StyleResolver* styleResolver = engine->resolver()) {
- if (change.styleResolverUpdateType != Additive) {
- ASSERT(change.styleResolverUpdateType == Reset);
- styleResolver->resetAuthorStyle(treeScope());
- engine->removeFontFaceRules(change.fontFaceRulesToRemove);
- styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets);
- styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAuthorStyleSheets());
- } else {
- styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), collection.activeAuthorStyleSheets());
- }
- }
- if (change.requiresFullStyleRecalc)
- document().setNeedsStyleRecalc(SubtreeStyleChange);
+ // TODO(esprehn): This is terrible and not needed in Sky, we should mark
+ // specific tree scopes dirty instead.
+ document().setNeedsStyleRecalc(SubtreeStyleChange);
collection.swap(*this);
« no previous file with comments | « sky/engine/core/dom/DocumentStyleSheetCollection.h ('k') | sky/engine/core/dom/ShadowTreeStyleSheetCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698