Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9dcd118ed1fb13ed0fa436ff468814a52dffda41
https://github.com/WebKit/WebKit/commit/9dcd118ed1fb13ed0fa436ff468814a52dffda41
Author: Sammy Gill <[email protected]>
Date: 2026-02-04 (Wed, 04 Feb 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp
M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp
M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.h
M Source/WebCore/layout/formattingContexts/grid/GridTypeAliases.h
M Source/WebCore/layout/formattingContexts/grid/PlacedGridItem.h
M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp
M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.h
Log Message:
-----------
[GFC] Add some initial logic to support track sizing with auto track sizing
functions
https://bugs.webkit.org/show_bug.cgi?id=306631
rdar://169291807
Reviewed by Alan Baradlay.
With this patch, we should now have some basic logic for each step in the
"Size tracks to fit non-spanning items," portion of the track sizing
algorithm.
https://drafts.csswg.org/css-grid-1/#algo-single-span-items
This does not mean we can call this section of the spec complete, but in
theory, we should be able to get some form of content running that goes
through this part of the spec (barring any bugs that need to be
resolved).
Similar to 306091@main and 306239@main, in which we added some support
for track sizing with min-content and max-content track sizing
functions, we basically translate the spec text into equivalent code.
One thing that may be notable is that this case is slightly more
complicated than just taking the min-content contribution or max-content
contribution like in the aforementioned patches. We may need to consider
the constraint the grid is being sized in or whether the grid item's
preferred size behaves as auto. For now, we just implement the simple
case where we take the minimum contribution of the items, which should
just come from the min-content contribution.
* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp:
(WebCore::Layout::GridFormattingContext::constructPlacedGridItems const):
* Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp:
(WebCore::Layout::GridLayout::performGridSizingAlgorithm const):
We need to start passing in the computed sizes in the appropriate
dimension of the grid items for this new scenario, so we can do a little
bit of refactoring here to accomplish this. Before, we were using
two calls to Vector::map to populate columnSpanList and rowSpanList.
Now, we can just have a single loop that populates the appropriate
structures.
* Source/WebCore/layout/formattingContexts/grid/PlacedGridItem.h:
Move the ComputedSizes struct outside PlacedGridItem so we can forward
declare it in other places.
Canonical link: https://commits.webkit.org/306779@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications