Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d2ed819e3191cd24af4d0160cc03bde62366ab3d
https://github.com/WebKit/WebKit/commit/d2ed819e3191cd24af4d0160cc03bde62366ab3d
Author: Sammy Gill <[email protected]>
Date: 2026-10-07 (Wed, 07 Oct 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/grid-container-min-max-height-abspos-descendant-001-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/grid-container-min-max-height-abspos-descendant-001.html
M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.h
M Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.cpp
M Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.h
Log Message:
-----------
[GFC] GridLayoutResult should return the grid's used block size.
https://bugs.webkit.org/show_bug.cgi?id=326607
rdar://problem/189357098
Reviewed by Alan Baradlay.
When the grid container's block size is indefinite, GridFormattingContext
reported the sum of its row sizes and row gaps as its block content size.
The integration code set that as the grid container's height, laid out
the out-of-flow boxes whose containing block is the grid container, and
only then called updateLogicalHeight(), which applies min-height and
max-height.
This meant that out-of-flow descendants were positioned and sized against
the grid container's height before min-height and max-height were applied.
One option would be to call updateLogicalHeight before running
out-of-flow boxes but that would be papering over the problem. Now that
I think about it running out-of-flow layout is probably one of the last
things we want to do in layout but we should probably address that
separately. The true problem is that when we compute the
blockContentSize we return that as part of GridLayoutResult but it
should really be the used size which means the min/max sizes are
applied.
This is important not only for the out-of-flow scenario that is
currently impacted but we will also need to have the used block size if
we need to run a second iteration of GridSizer (e.g. if any of the row
sizes are percent based).
So here when we compute the block content size we also apply the minimum
and maximum constraints. We also rename the field on GridLayoutResult to
match.
Test:
imported/w3c/web-platform-tests/css/css-grid/abspos/grid-container-min-max-height-abspos-descendant-001.html
(WebCore::Layout::GridFormattingContext::layout): Apply the grid container's
min-height and max-height to the block content size when the block axis is
indefinite, and rename it to usedBlockContentSize.
Canonical link: https://commits.webkit.org/323053@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications