Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ae2aca5d8313f4aa421b26869a831de014e2bb0c
      
https://github.com/WebKit/WebKit/commit/ae2aca5d8313f4aa421b26869a831de014e2bb0c
  Author: Yulun Wu <[email protected]>
  Date:   2026-09-23 (Wed, 23 Sep 2026)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp
    M Source/WebCore/layout/formattingContexts/grid/TrackSizingFunctions.h

  Log Message:
  -----------
  [GFC] Clamp space distribution for fit-content() tracks when distributing 
extra space
https://bugs.webkit.org/show_bug.cgi?id=324518
rdar://187757242

Reviewed by Sammy Gill.

This PR implements the fit-content() growth limits in
https://drafts.csswg.org/css-grid-1/#extra-space.

This PR updates initializeTrackSizes() to resolve and cache the fit-content()
limit of each track, if present. This is later used by freezeLimit() to stop
fit-content() tracks from growing beyond growth limits.

Fit content limit logic has also been extracted out of the TrackSizingAlgorithm
and to TrackSizingFunctions.

* Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp:
(WebCore::Layout::UnsizedTrack::freezeLimit const):
(WebCore::Layout::sizeTracksToFitNonSpanningItems):
(WebCore::Layout::initializeTrackSizes):
(WebCore::Layout::indexesForUnfrozenAffectedTracks):
(WebCore::Layout::distributeSpaceEquallyAmongTracks):
(WebCore::Layout::hasAffectedTrackSizingFunction):
(WebCore::Layout::shouldTrackGrowBeyondGrowthLimits):
* Source/WebCore/layout/formattingContexts/grid/TrackSizingFunctions.h:
(WebCore::Layout::MaxTrackSizingFunction::isFitContent const):
(WebCore::Layout::MaxTrackSizingFunction::fitContent const):
(WebCore::Layout::TrackSizingFunctions::fitContentLimit const):

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



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

Reply via email to