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

Unified Diff: Source/core/layout/TextAutosizer.cpp

Issue 1110233003: Update list markers in notify change. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add Rebaseline Created 5 years, 7 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/layout/TextAutosizer.h ('k') | Source/core/layout/line/LineLayoutState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/TextAutosizer.cpp
diff --git a/Source/core/layout/TextAutosizer.cpp b/Source/core/layout/TextAutosizer.cpp
index 22534a57959f789e903b3529bdd4a40be9d787aa..b2f29667b27eee380fc45bfaca8a8f0bdf2e712a 100644
--- a/Source/core/layout/TextAutosizer.cpp
+++ b/Source/core/layout/TextAutosizer.cpp
@@ -372,24 +372,6 @@ void TextAutosizer::beginLayout(LayoutBlock* block)
inflate(block);
}
-void TextAutosizer::inflateListItem(LayoutListItem* listItem, LayoutListMarker* listItemMarker)
-{
- if (!shouldHandleLayout())
- return;
- ASSERT(listItem && listItemMarker);
-
- if (prepareForLayout(listItem) == StopLayout)
- 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(currentCluster());
-
- applyMultiplier(listItem, multiplier);
- applyMultiplier(listItemMarker, multiplier);
-}
-
void TextAutosizer::inflateAutoTable(LayoutTable* table)
{
ASSERT(table);
@@ -456,6 +438,7 @@ float TextAutosizer::inflate(LayoutObject* parent, InflateBehavior behavior, flo
if (!multiplier)
multiplier = cluster->m_flags & SUPPRESSING ? 1.0f : clusterMultiplier(cluster);
applyMultiplier(child, multiplier);
+
// FIXME: Investigate why MarkOnlyThis is sufficient.
if (parent->isLayoutInline())
child->setPreferredLogicalWidthsDirty(MarkOnlyThis);
@@ -472,9 +455,25 @@ float TextAutosizer::inflate(LayoutObject* parent, InflateBehavior behavior, flo
applyMultiplier(parent, multiplier); // Parent handles line spacing.
} else if (!parent->isListItem()) {
// For consistency, a block with no immediate text child should always have a
- // multiplier of 1 (except for list items which are handled in inflateListItem).
+ // multiplier of 1.
applyMultiplier(parent, 1);
}
+
+ if (parent->isListItem()) {
+ float multiplier = clusterMultiplier(cluster);
brucedawson 2015/05/11 18:02:28 This variable shadows the same named parameter to
+ applyMultiplier(parent, multiplier);
+
+ // The list item has to be treated special because we can have a tree such that you have
+ // a list item for a form inside it. The list marker then ends up inside the form and when
+ // we try to get the clusterMultiplier we have the wrong cluster root to work from and get
+ // the wrong value.
+ LayoutListItem* item = toLayoutListItem(parent);
+ if (LayoutListMarker* marker = item->marker()) {
+ applyMultiplier(marker, multiplier);
+ marker->setPreferredLogicalWidthsDirty(MarkOnlyThis);
+ }
+ }
+
return multiplier;
}
@@ -940,7 +939,6 @@ const LayoutBlock* TextAutosizer::deepestBlockContainingAllText(const LayoutBloc
const LayoutObject* TextAutosizer::findTextLeaf(const LayoutObject* parent, size_t& depth, TextLeafSearch firstOrLast) const
{
// List items are treated as text due to the marker.
- // The actual layoutObject for the marker (LayoutListMarker) may not be in the tree yet since it is added during layout.
if (parent->isListItem())
return parent;
« no previous file with comments | « Source/core/layout/TextAutosizer.h ('k') | Source/core/layout/line/LineLayoutState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698