Skip to content

Commit

Permalink
[LayoutNG] RequiresContentBeforeBreaking() and OOF fragmentation
Browse files Browse the repository at this point in the history
We would previously always set RequiresContentBeforeBreaking() to true
for OOF positioned elements (see CL:3310887 for more details). However,
we should use the value of RequiresContentBeforeBreaking() of the CB as
the basis, instead.

Store an extra bit in NGContainingBlock to keep track of what
RequiresContentBeforeBreaking() should be for the CB. This will get
set when adjusting the newly created OOF fragmentainer descendant
in NGOutOfFlowLayoutPart. As a result, NGBoxFragmentBuilder::
AdjustOffsetsForFragmentainerDescendant() was renamed to
AdjustFragmentainerDescendant() since the method no longer is just
adjusting offsets.

tall-content-inside-constrained-block-003.tentative.html and
tall-content-inside-constrained-block-004.tentative.html were updated
based on the new logic, and two similar tests were added to
ensure this gets set correctly for |fixedpos_containing_block|.

Bug: 1319280
Change-Id: I450adb7e4a07c6948d76dcd3ec808a848483e8a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3611135
Reviewed-by: Morten Stenshorne <[email protected]>
Commit-Queue: Alison Maher <[email protected]>
Cr-Commit-Position: refs/heads/main@{#997220}
  • Loading branch information
alisonmaher authored and pull[bot] committed Sep 7, 2023
1 parent e5e9169 commit 1452185
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 2 deletions.
10 changes: 10 additions & 0 deletions css/css-break/out-of-flow-in-multicolumn-093-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<style>
ul { columns:1; height:20px; width:100px; line-height:20px; }
ul li { position:relative; list-style-type:none; font-size:20px; }
ul li::before { content:" \2022 "; position:absolute; top:0; left:-15px; }
</style>
<p>There should be a bullet to the left of the word "Bullet".</p>
<ul>
<li>Bullet</li>
</ul>
13 changes: 13 additions & 0 deletions css/css-break/out-of-flow-in-multicolumn-093.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1319280">
<link rel="match" href="out-of-flow-in-multicolumn-093-ref.html">
<style>
ul { columns:2; column-gap:0; height:20px; width:200px; line-height:20px; margin-left:-100px; }
ul li { position:relative; list-style-type:none; font-size:20px; }
ul li::before { content:" \2022 "; position:absolute; top:-2px; left:-15px; }
</style>
<p>There should be a bullet to the left of the word "Bullet".</p>
<ul>
<li>Bullet</li>
<li>Bullet</li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div style="columns:2; column-gap:0; column-fill:auto; height:75px;">
<div style="height:50px; background:green;"></div>
<div style="position:relative;">
<div style="position:absolute; width:100%; background:red;">
<div style="position:absolute; height:25px; width:100%; background:red;">
<div style="contain:size; height:50px; background:green;"></div>
<div style="contain:size; height:100px; background:green;"></div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div style="width:100px; height:100px; background:red;">
<div style="columns:2; column-gap:0; column-fill:auto; height:75px;">
<div style="height:50px; background:green;"></div>
<div style="position:relative; height:100px;">
<div style="position:relative; height:25px;">
<div style="position:absolute; width:100%; background:red;">
<div style="contain:size; height:50px; background:green;"></div>
<div style="contain:size; height:100px; background:green;"></div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6056#issuecomment-951767882">
<meta name="assert" content="">
<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="width:100px; height:100px; background:red;">
<div style="columns:2; column-gap:0; column-fill:auto; height:75px;">
<div style="height:50px; background:green;"></div>
<div style="transform:translateX(0);">
<div style="position:relative;">
<div style="position:absolute">
<div style="position:fixed; height:25px; width:100%; background:red;">
<div style="contain:size; height:50px; background:green;"></div>
<div style="contain:size; height:100px; background:green;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/6056#issuecomment-951767882">
<meta name="assert" content="">
<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="width:100px; height:100px; background:red;">
<div style="columns:2; column-gap:0; column-fill:auto; height:75px;">
<div style="height:50px; background:green;"></div>
<div style="transform:translateX(0); height:25px;">
<div style="position:relative;">
<div style="position:absolute">
<div style="position:fixed; width:100%; background:red;">
<div style="contain:size; height:50px; background:green;"></div>
<div style="contain:size; height:100px; background:green;"></div>
</div>
</div>
</div>
</div>
</div>
</div>

0 comments on commit 1452185

Please sign in to comment.