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

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

Issue 138143004: [FastTextAutosizer] Refactor FTA::inflate() to be internal to FTA (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | « Source/core/rendering/FastTextAutosizer.h ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | 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 94afe2061edc83d08c33ac53df3c42fda5761c6a..fb9e2a42f12705ccf147c2ebc29c36552cb3c06f 100644
--- a/Source/core/rendering/FastTextAutosizer.cpp
+++ b/Source/core/rendering/FastTextAutosizer.cpp
@@ -83,6 +83,18 @@ void FastTextAutosizer::beginLayout(RenderBlock* block)
if (shouldBeClusterRoot(block))
m_clusterStack.append(getOrCreateCluster(block));
+
+ if (block->childrenInline())
skobes 2014/01/15 01:12:20 Can a block return true for childrenInline() but h
pdr. 2014/01/15 07:08:54 Excellent catch, I found childrenInline() does not
+ inflate(block);
+}
+
+void FastTextAutosizer::endLayout(RenderBlock* block)
+{
+ if (!enabled())
+ return;
+
+ if (!m_clusterStack.isEmpty() && m_clusterStack.last()->m_root == block)
+ m_clusterStack.removeLast();
}
void FastTextAutosizer::inflate(RenderBlock* block)
@@ -94,7 +106,6 @@ void FastTextAutosizer::inflate(RenderBlock* block)
// localMultiplier is used to prevent inflation of some containers such as a row of links.
float localMultiplier = TextAutosizer::containerShouldBeAutosized(block) ? cluster->m_multiplier : 1;
- // FIXME: Add an optimization to not do this walk if it's not needed.
for (InlineWalker walker(block); !walker.atEnd(); walker.advance()) {
RenderObject* inlineObj = walker.current();
if (inlineObj->isText()) {
@@ -104,15 +115,6 @@ void FastTextAutosizer::inflate(RenderBlock* block)
}
}
-void FastTextAutosizer::endLayout(RenderBlock* block)
-{
- if (!enabled())
- return;
-
- if (!m_clusterStack.isEmpty() && m_clusterStack.last()->m_root == block)
- m_clusterStack.removeLast();
-}
-
bool FastTextAutosizer::enabled()
{
return m_document->settings()
« no previous file with comments | « Source/core/rendering/FastTextAutosizer.h ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698