Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 595bd709e8ef80a022f9c26b0831dd7455d7fe1e
https://github.com/WebKit/WebKit/commit/595bd709e8ef80a022f9c26b0831dd7455d7fe1e
Author: Sammy Gill <[email protected]>
Date: 2026-10-13 (Tue, 13 Oct 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/grid/ExplicitGridResolver.cpp
M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/grid/GridLayoutState.h
Log Message:
-----------
[GFC] Compute the collapsed tracks for repeat(auto-fit)
https://bugs.webkit.org/show_bug.cgi?id=327435
rdar://problem/189937668
Reviewed by Alan Baradlay.
https://drafts.csswg.org/css-grid-1/#valdef-repeat-auto-fit
The auto-fit keyword behaves the same as auto-fill, except that after
grid item placement any empty repeated tracks are collapsed.
This patch does the upfront work for that: the repeat(auto-fit) tracks
are now repeated like repeat(auto-fill) tracks, and once grid items are
placed we compute which of the auto-fit tracks are empty and store them
on GridLayoutState. Nothing reads the collapsed tracks yet; a follow-up
patch will use them to size collapsed tracks as 0px and to collapse
their gutters.
* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp:
(WebCore::Layout::collapsedTracksList):
(WebCore::Layout::collapsedColumnTracksList):
(WebCore::Layout::collapsedRowTracksList):
Compute the auto-fit tracks that no grid item is placed into or spans.
(WebCore::Layout::GridFormattingContext::layout):
Construct GridLayoutState after grid item placement so that it can hold
the collapsed tracks.
(WebCore::Layout::GridFormattingContext::computeIntrinsicWidths):
Pass the collapsed tracks to GridLayoutState.
Canonical link: https://commits.webkit.org/323658@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications