Commit ff69a9c8 authored by Benjamin Beaudry's avatar Benjamin Beaudry Committed by Chromium LUCI CQ

[LayoutNG] Fix OOF not painted in "tall" multicolumns

In some cases as the one described in https://crbug.com/1151383,
non-fragmented OOF are not painted. The computed |offset_from_root|
seems to be invalid and this CL fixes it.

Bug: 1151383
Change-Id: Ib85440577442782a1f09f704d2224214d4822232
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2607670
Commit-Queue: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841740}
parent c00a4d07
......@@ -409,8 +409,10 @@ PaintResult PaintLayerPainter::PaintLayerContents(
subsequence_recorder.emplace(context, paint_layer_);
}
PhysicalOffset offset_from_root;
paint_layer_.ConvertToLayerCoords(painting_info.root_layer, offset_from_root);
PhysicalOffset offset_from_root =
paint_layer_.GetLayoutObject().FirstFragment().PaintOffset();
if (const PaintLayer* root = painting_info.root_layer)
offset_from_root -= root->GetLayoutObject().FirstFragment().PaintOffset();
offset_from_root += subpixel_accumulation;
PhysicalRect bounds = paint_layer_.PhysicalBoundingBox(offset_from_root);
......
......@@ -1060,7 +1060,6 @@ crbug.com/1130451 virtual/layout_ng_block_frag/external/wpt/css/css-multicol/mul
crbug.com/1079031 virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-width-003.xht [ Crash Failure Timeout ]
crbug.com/829028 virtual/layout_ng_block_frag/external/wpt/css/css-multicol/multicol-width-004.html [ Failure ]
crbug.com/1079031 virtual/layout_ng_block_frag/fast/multicol/abspos-new-width-rebalance.html [ Crash Failure ]
crbug.com/1066616 virtual/layout_ng_block_frag/fast/multicol/border-radius-clipped-layer-second-column.html [ Failure ]
crbug.com/829028 virtual/layout_ng_block_frag/fast/multicol/client-rect-nested.html [ Failure ]
crbug.com/1058792 virtual/layout_ng_block_frag/fast/multicol/composited-layer-multiple-fragments-translated.html [ Failure Crash ]
crbug.com/1058792 virtual/layout_ng_block_frag/fast/multicol/composited-layer-multiple-fragments.html [ Failure Crash ]
......
<!DOCTYPE html>
<style>
div {
height: 300px;
width: 300px;
background-color: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div></div>
<!DOCTYPE html>
<link rel="help" href="https://www.w3.org/TR/css-position-3/#abspos-breaking">
<!-- This test requires a 300px tall multicolumn to reproduce the issue. -->
<link rel="match" href="out-of-flow-in-multicolumn-014-ref.html">
<!-- Fragmented OOF element with block-size percentage resolution and overflow. -->
<style>
#multicol {
columns: 2;
width: 300px;
height: 300px;
column-fill: auto;
column-gap: 0px;
background-color: red;
}
.rel {
position: relative;
}
.abs {
position: absolute;
top: 0px;
width: 150px;
height: 150px;
background: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="multicol">
<div style="width: 150px; height: 450px; background-color: green;"></div>
<div class="rel">
<div class="abs"></div>
</div>
</div>
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