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

Unified Diff: Source/core/rendering/FastTextAutosizer.cpp

Issue 265713002: [FastTextAutosizing] Remove FastTextAutosizer::enabled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update per reviewer comments Created 6 years, 8 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 | « Source/core/rendering/FastTextAutosizer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/FastTextAutosizer.cpp
diff --git a/Source/core/rendering/FastTextAutosizer.cpp b/Source/core/rendering/FastTextAutosizer.cpp
index 8101a264ad221cd373de61e4084e0ab267578ee8..3aae41fddf3bfb01295258722b4d15a1e02d5ff5 100644
--- a/Source/core/rendering/FastTextAutosizer.cpp
+++ b/Source/core/rendering/FastTextAutosizer.cpp
@@ -260,7 +260,7 @@ FastTextAutosizer::FastTextAutosizer(const Document* document)
void FastTextAutosizer::record(const RenderBlock* block)
{
- if (!enabled())
+ if (!m_pageInfo.m_settingEnabled)
return;
ASSERT(!m_blocksThatHaveBegunLayout.contains(block));
@@ -274,7 +274,7 @@ void FastTextAutosizer::record(const RenderBlock* block)
void FastTextAutosizer::destroy(const RenderBlock* block)
{
- if (!enabled())
+ if (!m_pageInfo.m_settingEnabled)
return;
ASSERT(!m_blocksThatHaveBegunLayout.contains(block));
@@ -460,20 +460,14 @@ void FastTextAutosizer::inflate(RenderBlock* block)
}
}
-// FIXME(crbug.com/367864): Unify this with m_pageInfo.m_settingEnabled.
-bool FastTextAutosizer::enabled() const
-{
- return m_document->settings() && m_document->settings()->textAutosizingEnabled();
-}
-
bool FastTextAutosizer::shouldHandleLayout() const
{
- return enabled() && m_pageInfo.m_pageNeedsAutosizing && !m_updatePageInfoDeferred;
+ return m_pageInfo.m_settingEnabled && m_pageInfo.m_pageNeedsAutosizing && !m_updatePageInfoDeferred;
}
void FastTextAutosizer::updatePageInfoInAllFrames()
{
- ASSERT(!enabled() || m_document->frame()->isMainFrame());
+ ASSERT(!m_document->frame() || m_document->frame()->isMainFrame());
for (LocalFrame* frame = m_document->frame(); frame; frame = frame->tree().traverseNext()) {
if (FastTextAutosizer* textAutosizer = frame->document()->fastTextAutosizer())
@@ -483,13 +477,13 @@ void FastTextAutosizer::updatePageInfoInAllFrames()
void FastTextAutosizer::updatePageInfo()
{
- if (m_updatePageInfoDeferred || !m_document->page())
+ if (m_updatePageInfoDeferred || !m_document->page() || !m_document->settings())
return;
PageInfo previousPageInfo(m_pageInfo);
- m_pageInfo.m_settingEnabled = enabled();
+ m_pageInfo.m_settingEnabled = m_document->settings()->textAutosizingEnabled();
- if (!enabled() || m_document->printing()) {
+ if (!m_pageInfo.m_settingEnabled || m_document->printing()) {
m_pageInfo.m_pageNeedsAutosizing = false;
} else {
RenderView* renderView = toRenderView(m_document->renderer());
« no previous file with comments | « Source/core/rendering/FastTextAutosizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698