Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1ce4a4952a8420d9ac98d480cfaa45ab01d7f0ca
https://github.com/WebKit/WebKit/commit/1ce4a4952a8420d9ac98d480cfaa45ab01d7f0ca
Author: Sammy Gill <[email protected]>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/grid/GridSizer.cpp
Log Message:
-----------
[GFC] Grid area's inline size should also include gutters when sizing rows.
https://bugs.webkit.org/show_bug.cgi?id=325004
rdar://188209644
Reviewed by Alan Baradlay.
oppositeAxisConstraintForTrackSizing() summed the sizes of the tracks a grid
item
spans and handed that to the track sizing algorithm as the available space in
the
opposite axis. However, this constraint is supposed to be the size of the grid
area
which is supposed to include the gutters that are covered between the spanned
tracks
as well. So what ended up happening is that oppositeAxisConstraintForTrackSizing
provided a value for the available space that was too small in some cases.
Instead we remove this function and just reuse a different one that already
correctly
adds in the gutters: GridLayoutUtils::gridAreaDimensionSize. This function
takes in
the start line, end line, size of the tracks, and the size of the gutters to
compute
the size of the spanned area.
Since we currently do not allow items that span multiple tracks to run via GFC
this
is not something that is observable via a test.
* Source/WebCore/layout/formattingContexts/grid/GridSizer.cpp:
(WebCore::Layout::GridSizer::sizeColumnTracks const):
Replace the call to oppositeAxisConstraintForTrackSizing with
GridLayoutUtils::gridAreaDimensionSize.
(WebCore::Layout::GridSizer::sizeRowTracks const):
We were already calling GridLayoutUtils::gridAreaDimensionSize
to compute the grid area's inline size to resolve any percentage
padding so we can reuse it as the constraint for the track sizing
algorithm to use in case it needs it.
(WebCore::Layout::oppositeAxisConstraintForTrackSizing): Deleted.
Canonical link: https://commits.webkit.org/321738@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications