Commit ee23dbd5 authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Fix NeedsShaping() not to include if length is zero

Zero-length text item was added in r652199 (crrev.com/c/1571113)
so that |NGLineBreaker| can call |ClearNeedsLayout()| for
fully-collapsed |LayoutText|.

This patch fixes such zero-length text items not to require
re-shaping when re-using existing |ShapeResult|.

Found when debugging crbug.com/963521.

Change-Id: I3d5a78463a1754daf8c9602ce1dcb855d603ade9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1824759Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699651}
parent e59fb34a
......@@ -398,7 +398,10 @@ inline bool ShouldBreakShapingAfterBox(const NGInlineItem& item,
}
inline bool NeedsShaping(const NGInlineItem& item) {
return item.Type() == NGInlineItem::kText && !item.TextShapeResult();
return item.Type() == NGInlineItem::kText && !item.TextShapeResult() &&
// Text item with length==0 exists to maintain LayoutObject states such
// as ClearNeedsLayout, but not needed to shape.
item.Length();
}
// Determine if reshape is needed for ::first-line style.
......
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