Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fd0d854eb31cc2124c1338675fa02c2b9e76e297
      
https://github.com/WebKit/WebKit/commit/fd0d854eb31cc2124c1338675fa02c2b9e76e297
  Author: Yulun Wu <[email protected]>
  Date:   2026-06-26 (Fri, 26 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-fixed-size-crash.html
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp
    M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp

  Log Message:
  -----------
  [GFC] Implement GridLayoutUtils::preferredSizeBehavesAsAuto
https://bugs.webkit.org/show_bug.cgi?id=317235
<rdar://179857225>

Reviewed by Sammy Gill.

This PR ports over RenderGrid's implementation of preferredSizeBehavesAsAuto()
and preferredSizeDependsOnContainingBlockSize() to GFC.

RenderGrid implements this part of the spec:

        "if the item’s computed preferred size behaves as auto or depends on 
the size of its containing block in the relevant axis"

with the check

        if (!gridItemSize.isAuto() && !gridItemSize.isPercentOrCalculated())

This behavior is inline with 
GridTrackSizingAlgorithmStrategy::minContributionForGridItem()
in the legacy RenderGrid, but does not yet handle stretch/fit content
in preferredSizeDependsOnContainingBlockSize(). preferredSizeBehavesAsAuto()
also only checks for auto preferred size, matching the RenderGrid 
implementation but
not yet implement the full spec.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-minimum-contribution-fixed-size-crash.html:
 Added.
* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp:
(WebCore::Layout::GridLayoutUtils::preferredSizeBehavesAsAuto):
(WebCore::Layout::GridLayoutUtils::preferredSizeDependsOnContainingBlockSize):
* Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp:

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



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

Reply via email to