Skip to content

Commit 82c4b7e

Browse files
[Masonry] Use max-content for stacking axis min-content
Per the proposal in [1], "Have the min-content size of the stacking axis of a masonry container be the same as its max-content size (same as the "stacking axis" of block layout)." This CL implements this proposal and updates the expectation of the test that kicked of this issue originally. It also fixes crashes in a few tests where orthogonal items in a row masonry had a larger min-content size than max-content size, leading to a check that expected the container min-content to be <= to the max-content size. [1] w3c/csswg-drafts#12843 (comment) Bug: 343257585 Change-Id: I35eab974b3518968ee4d686dfbc0adafa43f9a43 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7107410 Reviewed-by: Ian Kilpatrick <[email protected]> Commit-Queue: Alison Maher <[email protected]> Cr-Commit-Position: refs/heads/main@{#1539388}
1 parent 6a4953f commit 82c4b7e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

css/css-grid/masonry/tentative/item-placement/row-auto-placement-min-content-ref.html

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,14 @@
1010
.grid {
1111
display: grid;
1212
grid-template-rows: 15px auto auto;
13-
width: min-content;
13+
width: max-content;
14+
background: gray;
1415
align-items: start;
1516
padding: 10px;
1617
}
17-
18-
#gray-bg {
19-
background: gray;
20-
position: absolute;
21-
z-index: -1;
22-
}
2318
</style>
2419
<body>
2520
<p>Ensure that masonry containers are sized correctly under min-content constraints even if the items do not have the min-content style.</p>
26-
<div id="gray-bg"></div>
2721
<div id="shown-items" class="grid">
2822
<div style="background: lightskyblue; width: max-content; grid-row: 1; grid-column: 1;">
2923
Number 1

0 commit comments

Comments
 (0)