Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3e245b49512653adc1f21bea6542289e67d5a58d
https://github.com/WebKit/WebKit/commit/3e245b49512653adc1f21bea6542289e67d5a58d
Author: Alan Baradlay <[email protected]>
Date: 2026-09-29 (Tue, 29 Sep 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-043-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-043-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-043.html
M Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
M Source/WebCore/rendering/GridTrackSizingAlgorithm.h
Log Message:
-----------
Grid item with aspect-ratio and percentage height does not shrink when the
grid gets narrower
https://bugs.webkit.org/show_bug.cgi?id=325342
<rdar://problem/188444964>
Reviewed by Sammy Gill.
The first column pass of the grid sizing algorithm runs before the rows are
sized. At that point a grid item's grid area
block size (its containing block height) still holds the row size from the
previous layout. A percentage height resolved
against it, and aspect-ratio transferred that into a min-content width, so the
column (and the item) never got narrower
than in the previous layout.
Per https://drafts.csswg.org/css-grid-2/#algo-grid-sizing the block size
available to the item in this step comes from the
rows with a definite max track sizing function only; other rows (e.g. auto)
make it indefinite. When the estimate is
indefinite, measure the item against an indefinite grid area block size instead
of the previous layout's row size.
The fix is limited to regular track sizing (intrinsic sizing already uses the
estimate when it is definite) and to direct,
non-orthogonal grid items outside of grid lanes and subgridded rows for now.
Tests:
imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-043-ref.html
imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-043.html
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-043-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-043-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/grid-aspect-ratio-043.html:
Added.
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minContentContributionForGridItem
const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentContributionForGridItem
const):
(WebCore::GridTrackSizingAlgorithmStrategy::shouldTreatGridAreaBlockSizeAsIndefinite
const):
* Source/WebCore/rendering/GridTrackSizingAlgorithm.h:
Canonical link: https://commits.webkit.org/322176@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications