Commit e9454f0a authored by skobes@chromium.org's avatar skobes@chromium.org

Update line height when changing multiplier.

Line height is cached in the RenderBlock; when FTA updates a multiplier it needs to force recomputation of the line height.

(The old autosizer avoids this issue by using setStyle instead of setStyleInternal.  This triggers style recalc, which invalidates the line height.)

BUG=353309,354032

Review URL: https://codereview.chromium.org/209853007

git-svn-id: svn://svn.chromium.org/blink/trunk@169975 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 4fd2cc90
......@@ -755,7 +755,6 @@ crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/oscillation-jav
crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/narrow-iframe.html [ ImageOnlyFailure ]
crbug.com/322782 virtual/fasttextautosizing/fast/text-autosizing/clusters-insufficient-text.html [ ImageOnlyFailure ]
crbug.com/343201 virtual/fasttextautosizing/fast/text-autosizing/hackernews-comments.html [ Pass Failure ]
crbug.com/354032 virtual/fasttextautosizing/fast/text-autosizing/unlock-multipliers-on-DOMContentLoaded.html [ ImageOnlyFailure ]
crbug.com/353309 virtual/fasttextautosizing/fast/text-autosizing/resize-window.html [ Failure ]
# FIXME(crbug.com/332944): Remove this when hash-based autosizer performs sufficiently well on hackernews.
......
......@@ -802,6 +802,9 @@ void FastTextAutosizer::applyMultiplier(RenderObject* renderer, float multiplier
style->setTextAutosizingMultiplier(multiplier);
style->setUnique();
renderer->setStyleInternal(style.release());
if (renderer->isRenderBlock())
toRenderBlock(renderer)->invalidateLineHeight();
}
bool FastTextAutosizer::isWiderOrNarrowerDescendant(Cluster* cluster)
......
......@@ -343,7 +343,7 @@ void RenderBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldSty
textAutosizer->record(this);
propagateStyleToAnonymousChildren(true);
m_lineHeight = -1;
invalidateLineHeight();
// It's possible for our border/padding to change, but for the overall logical width of the block to
// end up being the same. We keep track of this change so in layoutBlock, we can know to set relayoutChildren=true.
......
......@@ -531,6 +531,8 @@ public:
virtual LayoutUnit offsetFromLogicalTopOfFirstPage() const OVERRIDE FINAL;
RenderRegion* regionAtBlockOffset(LayoutUnit) const;
void invalidateLineHeight() { m_lineHeight = -1; }
public:
// Allocated only when some of these fields have non-default values
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment