Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 561f5f0b1b232b530daee0a07dfbeee0c17d28fd
https://github.com/WebKit/WebKit/commit/561f5f0b1b232b530daee0a07dfbeee0c17d28fd
Author: Sammy Gill <[email protected]>
Date: 2026-07-03 (Fri, 03 Jul 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-block-axis-content-contribution-001-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-block-axis-content-contribution-001-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-block-axis-content-contribution-001.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-block-axis-content-contribution-002-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-block-axis-content-contribution-002.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-block-axis-content-contribution-003-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-block-axis-content-contribution-003.html
M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp
M
Source/WebCore/layout/integration/LayoutIntegrationFormattingContextLayout.h
M Source/WebCore/layout/integration/LayoutIntegrationUtils.cpp
M Source/WebCore/layout/integration/LayoutIntegrationUtils.h
Log Message:
-----------
[GFC] Incorrect block axis sizes during sizing of intrinsic rows.
https://bugs.webkit.org/show_bug.cgi?id=318406
rdar://problem/181195816
Reviewed by Alan Baradlay.
During the row sizing portion of the track sizing algorithm, the
algorithm may query a grid item for at least three different types of
sizes:
- min-content height
- min-content height contribution
- max-content height contribution
We already have three existing APIs for these within GridLayoutUtils,
but they were not really doing the right thing. All three were
ultimately calling layoutWithFormattingContextForBox with some sort if
inline constraint. This inline constraint was getting set as the
overriding border box size on the renderer associated with the grid item
before calling layout on it. Instead, what should have been happening is
that this constraint should have been setting the *grid area content
width* which was computed from the previous step in the algorithm since
the grid area is the containing block for the item.
We can fix this by doing a couple of main things:
1.) Adding a dedicated API into IntegrationUtils for the min/max content
height contributions and renaming the minContentHeight API to
minContentHeightForGridItem.
This first makes the grid layout much more clear since instead of mixing
integration level code with grid layout code we just call into the
integration API with the same name. Instead of grid layout being
responsible for determining how to compute this size it moves to the
integration code where it does whatever is needed to get the right value
back from the render tree.
2.) Set the grid area content width on the renderer before calling into
layoutWithFormattingContextForBox. Note we do not pass in any
constraints to layoutWithFormattingContextForBox since we do not want
it to set any overriding sizes on the renderer. This matches what
GridTrackSizingAlgorithm currently does to compute these sizes.
All three of these functions call into a helper function that switches
on the type of height the caller is interested in. Currently all three
cases do the same thing but this may change over time as we continue the
implementation.
Canonical link: https://commits.webkit.org/316469@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications