Skip to content

Commit 07201da

Browse files
[FlexNG] Forced break detection
We perform extra logic for forced breaks to properly handle top margins. However, we previously looked at HasForcedBreak(), which is also true if a descendant has a forced break. We only want to perform this logic if the current child break was forced. LastChildBreakToken() was added to detect this. I also noticed that we may consider an item that had previously broken before to have container separation because its previous sibling had overflow. Update the container separation logic for columns to always check if the current item previously broke. Bug: 660611 Change-Id: I08ae49dd88062afb0637f8f83be42879f774adab Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3533844 Reviewed-by: Morten Stenshorne <[email protected]> Commit-Queue: Alison Maher <[email protected]> Cr-Commit-Position: refs/heads/main@{#983330}
1 parent acb2a8a commit 07201da

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<title>
3+
Single-line column flex fragmentation: nested forced break with overflow.
4+
</title>
5+
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination">
6+
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
7+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
8+
<div style="width: 100px; height: 100px; columns: 2; column-fill: auto; column-gap: 0; background: red;">
9+
<div style="display: flex; flex-flow: column;">
10+
<div style="height: 100px; width: 50px; background: green;">
11+
<div style="height: 50px; width: 50px; background: green;"></div>
12+
<div style="height: 10px; width: 50px; background: green; break-before: column;"></div>
13+
</div>
14+
<div style="height: 50px; width: 50px; background: green; margin-top: 10px;"></div>
15+
<div style="height: 40px; width: 50px; background: green;"></div>
16+
</div>
17+
</div>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<title>
3+
Single-line column flex fragmentation: forced breaks with overflow.
4+
</title>
5+
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination">
6+
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">
7+
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
8+
<div style="width: 100px; height: 100px; columns: 2; column-fill: auto; column-gap: 0; background: red;">
9+
<div style="display: flex; flex-flow: column;">
10+
<div style="height: 100px; width: 50px; background: green;">
11+
<div style="height: 50px; width: 50px; background: green;"></div>
12+
<div style="height: 10px; width: 50px; background: green; break-before: column;"></div>
13+
</div>
14+
<div style="height: 50px; width: 50px; background: green; margin-top: 10px; break-before: column;"></div>
15+
<div style="height: 40px; width: 50px; background: green;"></div>
16+
</div>
17+
</div>

0 commit comments

Comments
 (0)