Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f3b648df34298128c912017a95df0e5c9dd68e57
      
https://github.com/WebKit/WebKit/commit/f3b648df34298128c912017a95df0e5c9dd68e57
  Author: Sammy Gill <[email protected]>
  Date:   2026-02-09 (Mon, 09 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/GridLayout.h
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutState.h
    M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp
    M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.h

  Log Message:
  -----------
  [GFC] Initial implementation of Stretch auto Tracks
https://bugs.webkit.org/show_bug.cgi?id=307124
rdar://169760592

Reviewed by Alan Baradlay.

In the final step of the track sizing algorithm, if there is any
definite free space left and there are tracks with an auto max track
sizing function, we should distribute it equally amongst those tracks.
This can only be down, however, if the content alignment property for
that dimension is either normal or stretch. This patch provides the
initial implementation for this step. The only missing portion is the
scenario in which the free space may be definite but the minimum
preferred size in that dimension is definite.
https://drafts.csswg.org/css-grid-1/#algo-stretch

* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp:
(WebCore::Layout::GridFormattingContext::layout):
Adds the content alignment values to GridLayoutState so that GridLayout,
and ultimately TrackSizingAlgorithm, will have access to it.

* Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp:
(WebCore::Layout::tracksWithAutoMaxTrackSizingFunction):
Helper function to help determine the tracks associated with the
"expands tracks that have an auto max track sizing function," of this
step.

(WebCore::Layout::totalGuttersSize):
Helper to compute the total space the gutters take up based on the
number of tracks. We previously had this logic in findSizeOfFr so we can
just share it between the two using this function.

(WebCore::Layout::computeFreeSpace):
Determines the free space available following the definition of "free
space," in the spec.

(WebCore::Layout::stretchAutoTracks):
Actual logic that will stretch the tracks with an auto max track sizing
function. There are a few cases in which we can bail early because
either the content alignment property does not allow it or it wouldn't
really make sense to continue (e.g. free space is indefinite or zero).

Canonical link: https://commits.webkit.org/307143@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to