Chromium Code Reviews| 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() |