Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a79fa11c6b40db82b5f368494c7a99149cb1f964
      
https://github.com/WebKit/WebKit/commit/a79fa11c6b40db82b5f368494c7a99149cb1f964
  Author: Sammy Gill <[email protected]>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

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

  Log Message:
  -----------
  [GFC] Create initial implementation for increase sizes to accommodate 
spanning items crossing flexible tracks.
https://bugs.webkit.org/show_bug.cgi?id=318818
rdar://181635324

Reviewed by Alan Baradlay.

This patch serves as the initial implementation of the "Increase sizes
to accommodate spanning items crossing flexible tracks," of the track
sizing algorithm.
https://www.w3.org/TR/css-grid-2/#algo-spanning-flex-items

This is all about going through all of the items that span flexible
tracks, taking whatever remaining space is left, and distributing them
in the order that is described in the spec (tracks with intrinsic
minimums, then content-based minimums, etc). Note that we do not have
the logic yet to actually perform the space distribution because I
wanted to do that separately in order to keep this patch focused. Also,
since we currently do not allow items that span multiple tracks we do
not implement the previous step in the track sizing algorithm which does
almost exactly the same thing but in a slightly different order. That
will also be done in a separate patch and will likely share code that is
introduced here.

* Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp:
(WebCore::Layout::ResolveIntrinsicTrackSizesContext::ResolveIntrinsicTrackSizesContext):
We need to know the type of constraint the grid is being sized under
(i.e. definite vs min-content vs max-content) so we can store it on this
context to use later.

(WebCore::Layout::fixedMaxTrackSizingFunctionSum):
(WebCore::Layout::limitedContentContributions):
We already had some of these helper functions to compute a specific type
of contributions among the items. Since the logic in the spec calls for
potentially querying the limited min/max content contributions we added
those here as well.

(WebCore::Layout::flexibleTracksMatching):
Depending on the specific step of the spec we need certain types of
flexible tracks depending on the the min track sizing function is. Since
this is a matter of querying the min track sizing function this helper
does most of the work by using the passed in predicate over all the
tracks

(WebCore::Layout::distributeExtraSpaceToBaseSizes):
This is currently just a stub function so that this patch is more
manageable to understand and is focused. The second part to implementing
this portion of the spec will require implementing the distribution
logic appropriately.

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



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

Reply via email to