Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c90715b4cf97033fd5acc77e7f4329771d21d1e4
https://github.com/WebKit/WebKit/commit/c90715b4cf97033fd5acc77e7f4329771d21d1e4
Author: Yulun Wu <[email protected]>
Date: 2026-02-12 (Thu, 12 Feb 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp
M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.h
Log Message:
-----------
[GFC] Add indefinite free space support for flex tracks.
https://bugs.webkit.org/show_bug.cgi?id=306932
<rdar://169596001>
Reviewed by Sammy Gill.
This PR implements flex track sizing when sized under a max content
constraint with indefinite free space.
Specifically, it implements this part of the spec:
Otherwise, if the free space is an indefinite length:
The used flex fraction is the maximum of:
- For each flexible track, if the flexible track’s flex factor is greater
than one,
the result of dividing the track’s base size by its flex factor; otherwise,
the track’s base size.
- For each grid item that crosses a flexible track, the result of finding
the size of an fr using
all the grid tracks that the item crosses and a space to fill of the item’s
max-content contribution.
* Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp:
(WebCore::Layout::TrackSizingAlgorithm::sizeTracks):
(WebCore::Layout::flexFractionFromTrackBaseSize):
(WebCore::Layout::itemCrossesFlexibleTrack):
(WebCore::Layout::applyFlexFractionToTracks):
(WebCore::Layout::TrackSizingAlgorithm::expandFlexibleTracksForMaxContent):
(WebCore::Layout::TrackSizingAlgorithm::expandFlexibleTracksForDefiniteLength):
(WebCore::Layout::TrackSizingAlgorithm::expandFlexibleTracks):
* Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.h:
Canonical link: https://commits.webkit.org/307367@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications