Commit 2304f6f1 authored by Emil A Eklund's avatar Emil A Eklund Committed by Commit Bot

Check actual text length in InlineTextBox::IsLineBreak

Check the length of the underlying string, rather than the length of the
text box as the two may differ due to text normalization.

Bug: 816768
Change-Id: Ibb91256200d51f6ec19dcff6e84bc12e5230f776
Reviewed-on: https://chromium-review.googlesource.com/942367
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540382}
parent fe79558b
......@@ -472,6 +472,7 @@ LayoutUnit InlineTextBox::PlaceEllipsisBox(bool flow_is_ltr,
bool InlineTextBox::IsLineBreak() const {
return GetLineLayoutItem().IsBR() ||
(GetLineLayoutItem().Style()->PreserveNewline() && Len() == 1 &&
GetLineLayoutItem().GetText().length() > Start() &&
(*GetLineLayoutItem().GetText().Impl())[Start()] == '\n');
}
......
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