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

[FragmentItem] Fix LayoutText::HasTextBoxes

This fixes paint invalidation problem, because this function
is used in |LayoutObject::AdjustStyleDifference| to optimize
invalidations.

Fixes ~45 failures.

Bug: 982194
Change-Id: I2c749aed856bdbf8e06b2fb5c1f50b266a68efb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2022444
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735337}
parent d6a88c28
...@@ -415,9 +415,12 @@ Vector<LayoutText::TextBoxInfo> LayoutText::GetTextBoxInfo() const { ...@@ -415,9 +415,12 @@ Vector<LayoutText::TextBoxInfo> LayoutText::GetTextBoxInfo() const {
bool LayoutText::HasTextBoxes() const { bool LayoutText::HasTextBoxes() const {
if (RuntimeEnabledFeatures::LayoutNGEnabled()) { if (RuntimeEnabledFeatures::LayoutNGEnabled()) {
auto fragments = NGPaintFragment::InlineFragmentsFor(this); if (IsInLayoutNGInlineFormattingContext()) {
if (fragments.IsInLayoutNGInlineFormattingContext()) NGInlineCursor cursor;
return !(fragments.begin() == fragments.end()); cursor.MoveTo(*this);
return cursor.IsNotNull();
}
// When legacy is forced, IsInLayoutNGInlineFormattingContext is false, // When legacy is forced, IsInLayoutNGInlineFormattingContext is false,
// and we fall back to normal HasTextBox // and we fall back to normal HasTextBox
return FirstTextBox(); return FirstTextBox();
......
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