Chromium Code Reviews| 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..c830fc22c001f267aa6bf5d8566e5d4beed1cad8 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,23 @@ 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 |
|
ojan
2015/01/10 04:50:54
Fixed! Remove.
|
| // 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(); |
| + // 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(); |
| + 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(); |
|
esprehn
2015/01/10 04:45:51
This is probably needed if you add/remove sheets w
|
| - } 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. |