Skip to content

Commit

Permalink
Fragments may become monolithic even if the node isn't.
Browse files Browse the repository at this point in the history
So ask the fragment instead of the LayoutBox. This is an old problem,
and it prevented pre-paint from understanding that a monolithic
fragment would be the containing block for OOF descendants (normally in
block fragmentation, OOFs are direct children of a fragmentainer, but
not if they are contained by a monolithic fragment, like in this case).
However, with CL:4110949 the problem became more severe, since we may
now force off fragmentation at the last OOF fragment (if it's inside a
clipped container), making it monolithic.

out-of-flow-in-multicolumn-112.html is a test for the regression, while
out-of-flow-in-multicolumn-113.html is a test that would fail even
without the aforementioned CL.

(cherry picked from commit 7073850)

Bug: 1404718
Change-Id: I68ebd5218c2bd0e3e895eaf757a90cbc8594a028
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4131528
Reviewed-by: Alison Maher <almaher@microsoft.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1088506}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4136433
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/branch-heads/5481@{#141}
Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
  • Loading branch information
mstensho authored and Chromium LUCI CQ committed Jan 5, 2023
1 parent ba5fb36 commit e67781e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2879,7 +2879,7 @@ void FragmentPaintPropertyTreeBuilder::UpdatePaintOffset() {
// descendants need special treatment inside block fragmentation.
context_.current.is_in_block_fragmentation =
pre_paint_info_->fragmentainer_is_oof_containing_block &&
box->GetNGPaginationBreakability() != LayoutBox::kForbidBreaks;
!pre_paint_info_->box_fragment.IsMonolithic();
} else {
// TODO(pdr): Several calls in this function walk back up the tree to
// calculate containers (e.g., physicalLocation,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1404718">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="columns:2; gap:0; column-fill:auto; width:100px; height:100px; background:red;">
<div style="height:150px; background:green;"></div>
<div style="position:relative; overflow:clip; height:50px;">
<div style="position:absolute; width:100%; height:20px; background:green;">
<div style="position:absolute; top:20px; width:100%; height:30px; background:green;"></div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1404718">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div style="columns:2; gap:0; column-fill:auto; width:100px; height:100px; background:red;">
<div style="height:40px; background:green;"></div>
<div style="position:relative; overflow:clip; height:60px;">
<div style="position:absolute; width:100%; height:60px; background:green;"></div>
<div style="height:100px;"></div>
</div>
<div style="height:40px; background:green;"></div>
<div style="position:relative; overflow:clip; height:60px;">
<div style="position:absolute; width:100%; height:60px; background:green;"></div>
<div style="height:100px;"></div>
</div>
</div>

0 comments on commit e67781e

Please sign in to comment.