-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FlexNG] MinBlockSizeShouldEncompassIntrinsicSize update
Update the MinBlockSizeShouldEncompassIntrinsicSize() definition to more accurately handle flex items during fragmentation. Credit to ikilpatrick@ for figuring out the correct logic. A couple of row specific tests were updated to match the new behavior, and a bunch of column specific tests were added to check various combinations of use cases. Bug: 660611 Change-Id: I1d9dded7189ab2d7b0c8c3e60c7f24e9c711212b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3600998 Commit-Queue: Alison Maher <[email protected]> Reviewed-by: Ian Kilpatrick <[email protected]> Cr-Commit-Position: refs/heads/main@{#996810}
- Loading branch information
1 parent
bd235e3
commit a4b4e67
Showing
10 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
css/css-break/flexbox/multi-line-column-flex-fragmentation-048.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Tests that a flex-item that shrinks *doesn't* expand. | ||
</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> | ||
<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; columns: 2; column-gap: 0; background: red;"> | ||
<div style="display: flex; flex-direction: column; flex-wrap: wrap; height: 200px;"> | ||
<div style="background: green; flex-basis: fit-content; height: 10px; width: 25px;"> | ||
<div style="contain: size; width: 25px; height: 50px;"></div> | ||
<div style="contain: size; width: 25px; height: 100px;"></div> | ||
</div> | ||
<div style="background: green; width: 25px; height: 50px;"></div> | ||
<div style="background: green; flex-basis: min-content; height: 10px; width: 25px;"> | ||
<div style="contain: size; width: 25px; height: 50px;"></div> | ||
<div style="contain: size; width: 25px; height: 100px;"></div> | ||
</div> | ||
<div style="background: green; width: 25px; height: 50px;"></div> | ||
</div> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
css/css-break/flexbox/multi-line-column-flex-fragmentation-049.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Tests that a flex-item with an indefinite flex-basis expands if the | ||
container hieght is auto. | ||
</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> | ||
<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; columns: 2; column-gap: 0; background: red;"> | ||
<div style="display: flex; flex-direction: column;"> | ||
<div style="background: green; flex-basis: content; height: 10px;"> | ||
<div style="contain: size; width: 50px; height: 50px;"></div> | ||
<div style="contain: size; width: 50px; height: 100px;"></div> | ||
</div> | ||
</div> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
css/css-break/flexbox/single-line-column-flex-fragmentation-050.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Tests that a flex-item with an indefinite flex-basis expands if the | ||
container height is auto. | ||
</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> | ||
<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; columns: 2; column-gap: 0; background: red;"> | ||
<div style="display: flex; flex-direction: column;"> | ||
<div style="background: green; flex-basis: content; height: 10px;"> | ||
<div style="contain: size; width: 50px; height: 50px;"></div> | ||
<div style="contain: size; width: 50px; height: 100px;"></div> | ||
</div> | ||
</div> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
css/css-break/flexbox/single-line-column-flex-fragmentation-051.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Tests that a flex-item with a definite flex-basis *doesn't* expand. | ||
</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> | ||
<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; columns: 2; column-gap: 0; background: red;"> | ||
<div style="display: flex; flex-direction: column;"> | ||
<div style="background: green; flex-basis: 10px; height: 10px;"> | ||
<div style="contain: size; width: 50px; height: 50px;"></div> | ||
<div style="contain: size; width: 50px; height: 100px;"></div> | ||
</div> | ||
<div style="background: green; width: 50px; height: 190px;"></div> | ||
</div> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
css/css-break/flexbox/single-line-column-flex-fragmentation-052.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Tests that a flex-item with an definite flex-basis but an indefinite height expands. | ||
</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> | ||
<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; columns: 2; column-gap: 0; background: red;"> | ||
<div style="display: flex; flex-direction: column;"> | ||
<div style="background: green; flex-basis: 10px;"> | ||
<div style="contain: size; width: 50px; height: 50px;"></div> | ||
<div style="contain: size; width: 50px; height: 100px;"></div> | ||
</div> | ||
</div> | ||
</div> |
18 changes: 18 additions & 0 deletions
18
css/css-break/flexbox/single-line-column-flex-fragmentation-053.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Tests that a flex-item that can't shrink and has a definite flex-basis, an | ||
indefinite height, and a non-auto min-height *doesn't* expand. | ||
</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> | ||
<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; columns: 2; column-gap: 0; background: red;"> | ||
<div style="display: flex; flex-direction: column; height: 100px;"> | ||
<div style="background: green; flex-basis: 10px; min-height: 10px;"> | ||
<div style="contain: size; width: 50px; height: 50px;"></div> | ||
<div style="contain: size; width: 50px; height: 100px;"></div> | ||
</div> | ||
<div style="background: green; width: 50px; height: 190px;"></div> | ||
</div> | ||
<div style="background: green; width: 50px; height: 100px;"></div> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
css/css-break/flexbox/single-line-column-flex-fragmentation-054.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Tests that a flex-item with an definite flex-basis, an indefinite height, and | ||
a non-auto min-height does expand. | ||
</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> | ||
<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; columns: 2; column-gap: 0; background: red;"> | ||
<div style="display: flex; flex-direction: column;"> | ||
<div style="background: green; flex-basis: 10px; min-height: 10px;"> | ||
<div style="contain: size; width: 50px; height: 50px;"></div> | ||
<div style="contain: size; width: 50px; height: 100px;"></div> | ||
</div> | ||
</div> | ||
</div> |
16 changes: 16 additions & 0 deletions
16
css/css-break/flexbox/single-line-column-flex-fragmentation-055.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Tests that a flex-item with an definite flex-basis, an indefinite height, and | ||
can't shrink does expand. | ||
</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> | ||
<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; columns: 2; column-gap: 0; background: red;"> | ||
<div style="display: flex; flex-direction: column;"> | ||
<div style="background: green; flex-basis: 10px; justify-self: flex-start;"> | ||
<div style="contain: size; width: 50px; height: 50px;"></div> | ||
<div style="contain: size; width: 50px; height: 100px;"></div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters