Commit 63caa5dd authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Simplify NGPaintFragment::DirtyLinesFromChangedChild

This patch simplifies DirtyLinesFromChangedChild in that:
1. Clearing FirstInlineFragment for all descendants do not
   seem necessary any longer. It turned out that this makes
   reusing line boxes harder, and not doing so doesn't fail
   any tests.
2. MarkLineBoxesDirtyFor checks PaintFragment, so checking
   here does not seem necessary. Not checking can avoid
   traversing to its containing block.

Bug: 636993
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I4d485f47731355c88a554d18843c3722f822e89a
Reviewed-on: https://chromium-review.googlesource.com/c/1288174
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600797}
parent 837b006d
...@@ -470,24 +470,8 @@ NGPaintFragment::FragmentRange NGPaintFragment::InlineFragmentsFor( ...@@ -470,24 +470,8 @@ NGPaintFragment::FragmentRange NGPaintFragment::InlineFragmentsFor(
} }
void NGPaintFragment::DirtyLinesFromChangedChild(LayoutObject* child) { void NGPaintFragment::DirtyLinesFromChangedChild(LayoutObject* child) {
if (child->IsInline()) { if (child->IsInline())
LayoutBlockFlow* const block = child->ContainingNGBlockFlow(); MarkLineBoxesDirtyFor(*child);
if (block && block->PaintFragment())
MarkLineBoxesDirtyFor(*child);
}
if (!child->IsInLayoutNGInlineFormattingContext())
return;
// We should rest first inline fragment for following tests:
// * fast/dom/HTMLObjectElement/fallback-content-behaviour.html
// * fast/dom/shadow/exposed-object-within-shadow.html
// * fast/lists/inline-before-content-after-list-marker.html
// * fast/lists/list-with-image-display-changed.html
for (LayoutObject* runner = child; runner;
runner = runner->NextInPreOrder(child)) {
if (!runner->IsInLayoutNGInlineFormattingContext())
continue;
runner->SetFirstInlineFragment(nullptr);
}
} }
bool NGPaintFragment::FlippedLocalVisualRectFor( bool NGPaintFragment::FlippedLocalVisualRectFor(
......
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