| Index: Source/core/rendering/FastTextAutosizer.cpp
|
| diff --git a/Source/core/rendering/FastTextAutosizer.cpp b/Source/core/rendering/FastTextAutosizer.cpp
|
| index c03f83e7fb669e76f2edf67fa1b357ab5f80efa6..2f98fd41a71297b0bfa3842b43090d07901cd2f8 100644
|
| --- a/Source/core/rendering/FastTextAutosizer.cpp
|
| +++ b/Source/core/rendering/FastTextAutosizer.cpp
|
| @@ -38,6 +38,8 @@
|
| #include "core/page/Page.h"
|
| #include "core/rendering/InlineIterator.h"
|
| #include "core/rendering/RenderBlock.h"
|
| +#include "core/rendering/RenderListItem.h"
|
| +#include "core/rendering/RenderListMarker.h"
|
| #include "core/rendering/RenderView.h"
|
| #include "core/rendering/TextAutosizer.h"
|
|
|
| @@ -97,6 +99,28 @@ void FastTextAutosizer::beginLayout(RenderBlock* block)
|
| inflate(block);
|
| }
|
|
|
| +void FastTextAutosizer::inflateListItem(RenderListItem* listItem, RenderListMarker* listItemMarker)
|
| +{
|
| + if (!enabled())
|
| + return;
|
| +#ifndef NDEBUG
|
| + m_blocksThatHaveBegunLayout.add(listItem);
|
| +#endif
|
| +
|
| + Cluster* cluster = currentCluster();
|
| + // FIXME: Why is this check needed?
|
| + if (!cluster)
|
| + return;
|
| +
|
| + // Force the LI to be inside the DBCAT when computing the multiplier.
|
| + // This guarantees that the DBCAT has entered layout, so we can ask for its width.
|
| + // It also makes sense because the list marker is autosized like a text node.
|
| + float multiplier = clusterMultiplier(cluster);
|
| +
|
| + applyMultiplier(listItem, multiplier);
|
| + applyMultiplier(listItemMarker, multiplier);
|
| +}
|
| +
|
| void FastTextAutosizer::endLayout(RenderBlock* block)
|
| {
|
| if (!enabled())
|
| @@ -301,6 +325,7 @@ float FastTextAutosizer::clusterMultiplier(Cluster* cluster)
|
| cluster->m_multiplier = cluster->m_parent ? clusterMultiplier(cluster->m_parent) : 1.0f;
|
| }
|
| }
|
| + ASSERT(cluster->m_multiplier);
|
| return cluster->m_multiplier;
|
| }
|
|
|
| @@ -350,6 +375,11 @@ const RenderBlock* FastTextAutosizer::findDeepestBlockContainingAllText(const Re
|
|
|
| const RenderObject* FastTextAutosizer::findTextLeaf(const RenderObject* parent, size_t& depth, TextLeafSearch firstOrLast)
|
| {
|
| + // List items are treated as text due to the marker.
|
| + // The actual renderer for the marker (RenderListMarker) may not be in the tree yet since it is added during layout.
|
| + if (parent->isListItem())
|
| + return parent;
|
| +
|
| if (parent->isEmpty())
|
| return parent->isText() ? parent : 0;
|
|
|
|
|