Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 941a729b4b0d30e3b761cb7d39fad05e19da4c42
      
https://github.com/WebKit/WebKit/commit/941a729b4b0d30e3b761cb7d39fad05e19da4c42
  Author: Sammy Gill <[email protected]>
  Date:   2026-01-29 (Thu, 29 Jan 2026)

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

  Log Message:
  -----------
  [GFC] Add some initial logic for computing grid item used minimum sizes.
https://bugs.webkit.org/show_bug.cgi?id=306501
rdar://169155238

Reviewed by Brandon Stewart.

We currently have some helper functions that help us resolve the used
preferred size for grid items in both dimensions. We will need to have a
similar set of functions for the minimum sizes. This patch serves as a
first step towards supporting that functionality by adding some initial
code that we can build upon.

The main function that callers will use is used{Inline,Block}MinimumSize
whenever they need to get the minimum size for a grid item. For some
cases, such as fixed and percentages, this is fairly straightforward to
resolve. The more interesting bit will be the automatic sizes since the
grid spec defines an algorithm to be used to figure out these automatic
sizes.

In this patch we add the two main helper functions that have an
implementation for resolving the sizes in the fixed, percentage, and
calculated cases since this is fairly straightforward. For the auto case
we also add some additional skeleton utility functions that will be
populated over time to properly resolve the auto sizes. The skeleton
follows the outline of the steps defined in:
https://drafts.csswg.org/css-grid-1/#min-size-auto

* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp:
(WebCore::Layout::GridLayoutUtils::containsAutoMinTrackSizingFunction):
(WebCore::Layout::GridLayoutUtils::containsFlexMaxTrackSizingFunction):
(WebCore::Layout::GridLayoutUtils::hasScrollableInlineOverflow):
(WebCore::Layout::GridLayoutUtils::hasScrollableBlockOverflow):
These set of functions are primarily used to determine whether or not
the grid item has a non-zero automatic minimum size as defined by the
set of requirements at the beginning of 6.6 of the spec.

(WebCore::Layout::GridLayoutUtils::inlineSpecifiedSizeSuggestion):
(WebCore::Layout::GridLayoutUtils::inlineTransferredSizeSuggestion):
(WebCore::Layout::GridLayoutUtils::inlineContentSizeSuggestion):
(WebCore::Layout::GridLayoutUtils::blockSpecifiedSizeSuggestion):
(WebCore::Layout::GridLayoutUtils::blockTransferredSizeSuggestion):
(WebCore::Layout::GridLayoutUtils::blockContentSizeSuggestion):
These six functions are used to help determine what the "content-based
minimum size," will be since it will need to be one of these values
depending on the axis.

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



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

Reply via email to