Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 388c734de77de805cc8029020ced570d971acfd7
      
https://github.com/WebKit/WebKit/commit/388c734de77de805cc8029020ced570d971acfd7
  Author: Sammy Gill <[email protected]>
  Date:   2026-02-13 (Fri, 13 Feb 2026)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp
    M Source/WebCore/layout/integration/grid/LayoutIntegrationGridCoverage.cpp

  Log Message:
  -----------
  [GFC][Integration] Allow auto as track sizing function for rows
https://bugs.webkit.org/show_bug.cgi?id=307725
rdar://170275313

Reviewed by Alan Baradlay.

We should now have an implementation inside of GFC to be able to size
rows with an auto track sizing function (assuming no other
restrictions to enter GFC like spanning items). We can now relax this
requirement and allow GFC to run this type of content, such as the
following:

<div style="display: grid; width: 100px; height: 100px; grid-template-columns: 
25px 25px 5px; grid-template-rows: auto; min-width: 0; min-height: 0; outline: 
3px solid green;">
  <div style="outline: 1px solid red; grid-column: 1/2; grid-row: 1/2; 
min-width: 0; min-height: 0;">x x x x</div>
  <div style="outline: 1px solid red; grid-column: 2/3; grid-row: 1/2; 
min-width: 0; min-height: 0;">x x x x xx</div>
</div>

* Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp:
(WebCore::Layout::rowSizesForFirstIterationColumnSizing):
We need to return LayoutUnit::max() here since "auto," is not a definite
max track sizing function. This comes from the following portion of the
spec:

"If calculating the layout of a grid item in this step depends on the
available space in the block axis, assume the available space that it
would have if any row with a definite max track sizing function had
that size and all other rows were infinite."
https://drafts.csswg.org/css-grid-1/#algo-grid-sizing

* Source/WebCore/layout/integration/grid/LayoutIntegrationGridCoverage.cpp:
(WebCore::LayoutIntegration::gridLayoutAvoidanceReason):
"auto" is the last bit of the <track-breadth> syntax
<track-breadth> = <length-percentage [0,∞]> | <flex [0,∞]> | min-content | 
max-content | auto
Since we know the track size is a track-breadth at this point and since
we support all other values, we can remove the rest of the logic and
just return std::nullopt.

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



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

Reply via email to