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

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

Issue 836383005: Don't walk treescopes in updateActiveStyleSheets until the resolver exists. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove comments. Created 5 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
« no previous file with comments | « sky/engine/core/dom/StyleSheetCollection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/StyleSheetCollection.cpp
diff --git a/sky/engine/core/dom/StyleSheetCollection.cpp b/sky/engine/core/dom/StyleSheetCollection.cpp
index 0d4cdd73b3ff3173f6a342874d6c00db35586f41..937b28fc668e7638a9fb6ee8cf146152410ba8ea 100644
--- a/sky/engine/core/dom/StyleSheetCollection.cpp
+++ b/sky/engine/core/dom/StyleSheetCollection.cpp
@@ -30,7 +30,6 @@
#include "sky/engine/core/css/CSSStyleSheet.h"
#include "sky/engine/core/css/resolver/StyleResolver.h"
#include "sky/engine/core/dom/Document.h"
-#include "sky/engine/core/dom/StyleEngine.h"
#include "sky/engine/core/dom/shadow/ShadowRoot.h"
#include "sky/engine/core/dom/TreeScope.h"
#include "sky/engine/core/html/HTMLStyleElement.h"
@@ -69,31 +68,19 @@ void StyleSheetCollection::collectStyleSheets(Vector<RefPtr<CSSStyleSheet>>& she
}
}
-void StyleSheetCollection::updateActiveStyleSheets(StyleEngine* engine)
+void StyleSheetCollection::updateActiveStyleSheets(StyleResolver& resolver)
{
- // TODO(esprehn): We need to check if the resolver exists otherwise style
- // doesn't get computed right. We should figure out why.
- if (!m_needsUpdate && engine->resolver())
+ if (!m_needsUpdate)
return;
Vector<RefPtr<CSSStyleSheet>> candidateSheets;
collectStyleSheets(candidateSheets);
- Node& root = m_treeScope.rootNode();
+ m_treeScope.scopedStyleResolver().resetAuthorStyle();
+ resolver.removePendingAuthorStyleSheets(m_activeAuthorStyleSheets);
+ resolver.lazyAppendAuthorStyleSheets(0, candidateSheets);
- // TODO(esprehn): Remove special casing for Document.
- if (root.isDocumentNode()) {
- engine->clearResolver();
- // 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()) {
- // We should not destroy StyleResolver when we find any stylesheet update in a shadow tree.
- // In this case, we will reset rulesets created from style elements in the shadow tree.
- m_treeScope.scopedStyleResolver().resetAuthorStyle();
- styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets);
- styleResolver->lazyAppendAuthorStyleSheets(0, candidateSheets);
- }
+ Node& root = m_treeScope.rootNode();
// TODO(esprehn): We should avoid subtree recalcs in sky when rules change
// and only recalc specific tree scopes.
« no previous file with comments | « sky/engine/core/dom/StyleSheetCollection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698