Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GridNG] Don't consider a subgridded axis size in ExpandFlexibleTracks
1. Fixing a bug where `ExpandFlexibleTracks` considered the contribution size of a subgrid in its subgridded axis, triggering a DCHECK when its `NGGridLayoutTrackCollection` is not able perform the sizing algorithm since it's inherited by the subgrid's parent grid. From https://drafts.csswg.org/css-grid-2/#subgrid-size-contribution, in this scenario we should treat the subgrid contribution size as empty and not consider it when resolving the size of an `fr`. 2. Adding test coverage to the WPT suite for this issue. (cherry picked from commit 99b1299) Bug: 1447363 Change-Id: I0a31399a3cb29ffcfa696bc5cdf583150280a1d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4571270 Commit-Queue: Ethan Jimenez <ethavar@microsoft.com> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1150050} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574058 Reviewed-by: Alison Maher <almaher@microsoft.com> Cr-Commit-Position: refs/branch-heads/5790@{#150} Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
- Loading branch information
Showing
4 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
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
42 changes: 42 additions & 0 deletions
42
.../blink/web_tests/external/wpt/css/css-grid/subgrid/contribution-size-flex-tracks-001.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,42 @@ | ||
<!DOCTYPE HTML> | ||
<!-- | ||
Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
--> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>CSS Grid Test: Subgrid contribution size to flexible tracks</title> | ||
<link rel="author" title="Ethan Jimenez" href="mailto:ethavar@microsoft.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-grid-2/#subgrid-size-contribution"> | ||
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> | ||
<style> | ||
.grid { | ||
background: red; | ||
display: inline-grid; | ||
grid-template: repeat(4, minmax(0, 1fr)) / repeat(10, minmax(0, 1fr)); | ||
} | ||
.subgrid { | ||
width: 50px; | ||
height: 50px; | ||
background: green; | ||
display: grid; | ||
grid-row: 1 / -1; | ||
grid-column: 1 / -1; | ||
grid-template: subgrid / subgrid; | ||
} | ||
.item { | ||
width: 10px; | ||
height: 25px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div class="grid"> | ||
<div class="subgrid"> | ||
<div class="item"></div> | ||
</div> | ||
</div> | ||
</body> | ||
</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
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