Commit 0971bd8b authored by Koji Ishii's avatar Koji Ishii Committed by Commit Bot

[LayoutNG] Mark first line box dirty only when it exists

When marking the first line box dirty, this patch checks
if the line box exists.

Normally NGBlockLayoutAlgorithm suppresses box fragment
if no line boxes exist. However, NGColumnLayoutAlgorithm
may generate box fragments for column boxes.

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: Ie5697a524cd6fc1067fc4c03466e88fa8d5da68b
Reviewed-on: https://chromium-review.googlesource.com/c/1288769Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600969}
parent 0f9cb68f
......@@ -581,15 +581,17 @@ void NGPaintFragment::MarkLineBoxesDirtyFor(const LayoutObject& layout_object) {
if (parent.IsInline() && !parent.IsAtomicInlineLevel())
return MarkLineBoxesDirtyFor(parent);
if (!parent.IsLayoutNGMixin())
return;
const LayoutBlockFlow& block = ToLayoutBlockFlow(parent);
if (!block.PaintFragment()) {
// We have not yet layout.
return;
// The |layout_object| is inserted into an empty block.
// Mark the first line box dirty.
if (parent.IsLayoutNGMixin()) {
const LayoutBlockFlow& block = ToLayoutBlockFlow(parent);
if (NGPaintFragment* paint_fragment = block.PaintFragment()) {
if (NGPaintFragment* first_line = paint_fragment->FirstLineBox()) {
first_line->is_dirty_inline_ = true;
return;
}
}
}
// We inserted |layout_object| into empty block.
block.PaintFragment()->FirstLineBox()->is_dirty_inline_ = true;
}
void NGPaintFragment::MarkLineBoxDirty() {
......
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