Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 52a644bb63c7a2f4dc4699a04b7927a4f527dbb4
      
https://github.com/WebKit/WebKit/commit/52a644bb63c7a2f4dc4699a04b7927a4f527dbb4
  Author: Sammy Gill <[email protected]>
  Date:   2026-10-13 (Tue, 13 Oct 2026)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/grid/GridItemSizingFunctions.cpp
    M Source/WebCore/layout/formattingContexts/grid/GridItemSizingFunctions.h
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.h
    M Source/WebCore/layout/formattingContexts/grid/GridSizer.cpp
    M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp
    M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.h

  Log Message:
  -----------
  [GFC] Fill out the remaining logic for the specified size suggestion.
https://bugs.webkit.org/show_bug.cgi?id=327280
rdar://182848126

Reviewed by Alan Baradlay.

When a grid item has an automatic minimum size, such as min-width: auto,
we will need to compute this size as specified in that portion of the
spec: https://drafts.csswg.org/css-grid-1/#min-size-auto

One way this size may be determined is by using the specified size
suggestion which is basically just that size (e.g. the width property)
if it is definite. We already had some code that implemented the
specified size suggestion depending on what the value of what the
width/height property for the grid item is. Here we just implement the
remaining portion which is the stretch size.

We already have a helper function which computes the stretch size as
part of the final sizing of the grid item after track sizing is finished
so we can do this by just reusing the same function during track sizing.
Since this requires us to know the margins of the grid item we also need
to plumb it into TrackSizingAlgorithm. We do this by adding this onto
the TrackSizingItem helper struct we have to hold data needed for track
sizing.

* Source/WebCore/layout/formattingContexts/grid/GridItemSizingFunctions.cpp:
(WebCore::Layout::GridItemSizingFunctions::inlineAxis):
(WebCore::Layout::GridItemSizingFunctions::blockAxis):
Take the used margins and pass them to the automatic minimum size functions.

* Source/WebCore/layout/formattingContexts/grid/GridItemSizingFunctions.h:
Add a UsedMargins parameter to usedMinimumSize.
* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp:

(WebCore::Layout::GridLayoutUtils::automaticMinimumInlineSize):
(WebCore::Layout::GridLayoutUtils::automaticMinimumBlockSize):
Now that we are plumbing in the used margins into track sizing, which
end up here, we can just reuse the argument instead of computing them
from the same helper function.

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



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

Reply via email to