Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4de494305574a8ebc4aca8c248ada4f4bf1fcee8
      
https://github.com/WebKit/WebKit/commit/4de494305574a8ebc4aca8c248ada4f4bf1fcee8
  Author: Sammy Gill <[email protected]>
  Date:   2026-08-31 (Mon, 31 Aug 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/minmax-tracks-with-fixed-breadths-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/minmax-tracks-with-fixed-breadths.html
    M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp

  Log Message:
  -----------
  [GFC] Fixed track sizing functions get overridden during "size tracks to fit 
non-spanning items".
https://bugs.webkit.org/show_bug.cgi?id=322871
rdar://problem/186117142

Reviewed by Alan Baradlay.

sizeTracksToFitNonSpanningItems() implements the step of the track sizing 
algorithm which
sizes the intrinsic breadths of a track from the items in it:
https://drafts.csswg.org/css-grid-2/#algo-single-span-items

That step has a clause for each intrinsic breadth, and none for a 
<length-percentage> one,
since Initialize Track Sizes already resolved those to an absolute length. Both 
switchOn()
over the track sizing functions assigned unconditionally though, so a 
<length-percentage>
breadth fell into the ASSERT_NOT_REACHED() case and overwrote the resolved size 
with zero.

Instead, we should just return the base size/growth limit that was
determined during the "Initialize Track Sizes," step.

Test: 
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/minmax-tracks-with-fixed-breadths.html

The test covers each of the fixed, percentage and calculated breadths against 
each of the
auto, min-content and max-content breadths, in both the minimum and the maximum 
position. It
is limited to rows because an implicit column cannot be run through GFC yet, 
whether it comes
from a column auto flow or from an item placed past the explicit grid, so the 
equivalent
grid-auto-columns cases are still handled by legacy grid layout.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/minmax-tracks-with-fixed-breadths-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/minmax-tracks-with-fixed-breadths.html:
 Added.
* Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp:
(WebCore::Layout::sizeTracksToFitNonSpanningItems): Keep the base size and the 
growth limit
which Initialize Track Sizes resolved for a <length-percentage> breadth.

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



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

Reply via email to