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

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

Issue 846183002: Remove tracking of pending sheets. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/StyleEngine.h ('k') | sky/engine/core/dom/StyleSheetCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/StyleEngine.cpp
diff --git a/sky/engine/core/dom/StyleEngine.cpp b/sky/engine/core/dom/StyleEngine.cpp
index 18d33911636c6d280789be3e118bd3095bbf5945..20c7a0471f1c9f1cc1ed58685421b17e31c29ce3 100644
--- a/sky/engine/core/dom/StyleEngine.cpp
+++ b/sky/engine/core/dom/StyleEngine.cpp
@@ -41,11 +41,13 @@
#include "sky/engine/core/html/HTMLStyleElement.h"
#include "sky/engine/core/html/imports/HTMLImportsController.h"
#include "sky/engine/core/page/Page.h"
+#include "sky/engine/core/rendering/RenderView.h"
namespace blink {
StyleEngine::StyleEngine(Document& document)
: m_document(&document)
+ , m_resolver(adoptPtr(new StyleResolver(*m_document)))
, m_fontSelector(CSSFontSelector::create(&document))
{
m_fontSelector->registerForInvalidationCallbacks(this);
@@ -75,53 +77,26 @@ void StyleEngine::updateActiveStyleSheets()
for (TreeScope* treeScope : m_activeTreeScopes)
treeScope->styleSheets().updateActiveStyleSheets(*m_resolver);
-}
-
-void StyleEngine::appendActiveAuthorStyleSheets()
-{
- for (TreeScope* treeScope : m_activeTreeScopes)
- m_resolver->appendAuthorStyleSheets(treeScope->styleSheets().activeAuthorStyleSheets());
-
- m_resolver->finishAppendAuthorStyleSheets();
-}
-
-void StyleEngine::createResolver()
-{
- // It is a programming error to attempt to resolve style on a Document
- // which is not in a frame. Code which hits this should have checked
- // Document::isActive() before calling into code which could get here.
-
- ASSERT(m_document->frame());
- m_resolver = adoptPtr(new StyleResolver(*m_document));
-
- appendActiveAuthorStyleSheets();
-}
-
-void StyleEngine::clearResolver()
-{
- ASSERT(!m_document->inStyleRecalc());
- m_resolver.clear();
+ m_document->renderView()->style()->font().update(fontSelector());
}
unsigned StyleEngine::resolverAccessCount() const
{
- return m_resolver ? m_resolver->accessCount() : 0;
+ return m_resolver->accessCount();
}
void StyleEngine::resolverChanged()
{
if (!m_document->isActive())
return;
- if (m_resolver)
- updateActiveStyleSheets();
+ updateActiveStyleSheets();
}
void StyleEngine::clearFontCache()
{
m_fontSelector->fontFaceCache()->clearCSSConnected();
- if (m_resolver)
- m_resolver->invalidateMatchedPropertiesCache();
+ m_resolver->invalidateMatchedPropertiesCache();
}
void StyleEngine::updateGenericFontFamilySettings()
@@ -131,8 +106,7 @@ void StyleEngine::updateGenericFontFamilySettings()
ASSERT(m_document->isActive());
m_fontSelector->updateGenericFontFamilySettings(*m_document);
- if (m_resolver)
- m_resolver->invalidateMatchedPropertiesCache();
+ m_resolver->invalidateMatchedPropertiesCache();
}
PassRefPtr<CSSStyleSheet> StyleEngine::createSheet(Element* e, const String& text)
@@ -170,8 +144,7 @@ void StyleEngine::removeSheet(StyleSheetContents* contents)
void StyleEngine::fontsNeedUpdate(CSSFontSelector*)
{
- if (m_resolver)
- m_resolver->invalidateMatchedPropertiesCache();
+ m_resolver->invalidateMatchedPropertiesCache();
m_document->setNeedsStyleRecalc(SubtreeStyleChange);
}
« no previous file with comments | « sky/engine/core/dom/StyleEngine.h ('k') | sky/engine/core/dom/StyleSheetCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698