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

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

Issue 838003008: Get rid of ensureStyleResolver(). (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/Document.h ('k') | sky/engine/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Document.cpp
diff --git a/sky/engine/core/dom/Document.cpp b/sky/engine/core/dom/Document.cpp
index 0eda95164f0c5367d85174e9aac75495e7b5e698..72eba2fb419b8a362a5083bfeff90a32e91dca1c 100644
--- a/sky/engine/core/dom/Document.cpp
+++ b/sky/engine/core/dom/Document.cpp
@@ -1061,7 +1061,7 @@ void Document::updateStyle(StyleRecalcChange change)
if (styleChangeType() >= SubtreeStyleChange)
change = Force;
- // FIXME: Cannot access the ensureStyleResolver() before calling styleForDocument below because
+ // FIXME: Cannot access the styleResolver() before calling styleForDocument below because
// apparently the StyleResolver's constructor has side effects. We should fix it.
// See printing/setPrinting.html, printing/width-overflow.html though they only fail on
// mac when accessing the resolver by what appears to be a viewport size difference.
@@ -1079,9 +1079,9 @@ void Document::updateStyle(StyleRecalcChange change)
// Optionally pass StyleResolver::ReportSlowStats to print numbers that require crawling the
// entire DOM (where collecting them is very slow).
// FIXME: Expose this as a runtime flag.
- // ensureStyleResolver().enableStats(/*StyleResolver::ReportSlowStats*/);
+ // styleResolver().enableStats(/*StyleResolver::ReportSlowStats*/);
- if (StyleResolverStats* stats = ensureStyleResolver().stats())
+ if (StyleResolverStats* stats = styleResolver().stats())
stats->reset();
if (Element* documentElement = this->documentElement()) {
@@ -1089,7 +1089,7 @@ void Document::updateStyle(StyleRecalcChange change)
documentElement->recalcStyle(change);
}
- ensureStyleResolver().printStats();
+ styleResolver().printStats();
view()->recalcOverflowAfterStyleChange();
@@ -1159,14 +1159,7 @@ void Document::clearFocusedElementTimerFired(Timer<Document>*)
m_focusedElement->blur();
}
-StyleResolver* Document::styleResolver() const
-{
- if (!isActive())
- return 0;
- return &m_styleEngine->resolver();
-}
-
-StyleResolver& Document::ensureStyleResolver() const
+StyleResolver& Document::styleResolver() const
{
ASSERT(isActive());
return m_styleEngine->resolver();
@@ -1584,7 +1577,7 @@ void Document::notifyResizeForViewportUnits()
m_mediaQueryMatcher->viewportChanged();
if (!hasViewportUnits())
return;
- ensureStyleResolver().notifyResizeForViewportUnits();
+ styleResolver().notifyResizeForViewportUnits();
setNeedsStyleRecalcForViewportUnits();
}
« no previous file with comments | « sky/engine/core/dom/Document.h ('k') | sky/engine/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698