Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6f468a74bb80233cf5761b0a24f03ec4dfcb4702
https://github.com/WebKit/WebKit/commit/6f468a74bb80233cf5761b0a24f03ec4dfcb4702
Author: Sammy Gill <[email protected]>
Date: 2026-09-14 (Mon, 14 Sep 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp
M Source/WebCore/style/values/grid/StyleGridTrackSizes.cpp
M Source/WebCore/style/values/grid/StyleGridTrackSizes.h
Log Message:
-----------
[GFC] Map grid-auto-{columns,rows} sizes to leading tracks.
https://bugs.webkit.org/show_bug.cgi?id=323908
rdar://182725166
Reviewed by Alan Baradlay.
https://drafts.csswg.org/css-grid-1/#auto-tracks has the implicit tracks on
either side of the explicit grid cycle through grid-auto-{columns,rows} in
opposite directions: "The first track after the last explicitly-sized track
receives the first specified size, and so on forwards; and the last implicit
grid track before the explicit grid receives the last specified size, and so on
backwards."
GridLayout::trackSizingFunctions cycled both the leading and the trailing
implicit tracks forwards from the first specified size. That is only correct for
the trailing tracks, and for any single-value grid-auto-{columns,rows} where the
direction cannot be observed.
Generate the leading tracks from a reversed grid-auto-{columns,rows} and append
that result back to front. Composing the two reversals produces the backwards
ordering without having to modify the code that actually assigns the functions.
* Source/WebCore/style/values/grid/StyleGridTrackSizes.cpp:
(WebCore::Style::reversedTrackSizes):
Add the reversal function as part of the associated Style class since that is
what is operating it on. I think this is better than having it live alongside
the actual layout code since this is a simple mutation over the data rather
than an operation that layout really cares about.
Canonical link: https://commits.webkit.org/321070@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications