Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5a636ef55dd96d05288e2d4b5097ab00524f6df9
https://github.com/WebKit/WebKit/commit/5a636ef55dd96d05288e2d4b5097ab00524f6df9
Author: Sammy Gill <[email protected]>
Date: 2026-06-29 (Mon, 29 Jun 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp
A Source/WebCore/layout/formattingContexts/grid/GridSizeTypes.h
Log Message:
-----------
[GFC] Add size type wrapper structs to help annotate code.
https://bugs.webkit.org/show_bug.cgi?id=316311
rdar://problem/178734954
Reviewed by Brandon Stewart.
Introduce ContentBoxSize, BorderBoxSize, and MarginBoxSize wrapper types in
GridSizeTypes.h to make size type conversions explicit inside grid
sizing code. The idea is that these wrapper types are only used *within*
the public API and any internal functions it needs to compute the
returned size. The only time the value should be extracted from the
wrapper type is when we are returning the value from the public API.
Right now these functions return the BorderBoxSize simply because that
is what they currently compute, but eventually they will return a
MarginBoxSize since that is the size grid layout uses.
This helps make it obvious how the returned value is computed and also
makes it obvious if there are any bugs. In fact, there were a few
different spots where we were incorrectly using mixed types when we
should not have been and we fix those in this PR:
- inlineContentSizeSuggestion returned a content-box value (from
IntegrationUtils::minContentWidth) but was mixed with border-box values
from inlineSpecifiedSizeSuggestion in automaticMinimumInlineSize. Fixed
by constructing BorderBoxSize from ContentBoxSize + borderAndPadding.
- The max-size clamp in automaticMinimumInlineSize/automaticMinimumBlockSize
compared a border-box content-based minimum against a content-box max-size
value. Fixed by converting the max-size to border-box before comparison.
- usedInlineSizeForGridItem/usedBlockSizeForGridItem compared a border-box
minimumSize against content-box stretchedWidth and content-box maximumSize.
Fixed by computing all three at the border-box level.
However, since we currently do not run GFC if any of the items have any
border or padding this has no effect on any type of content that does
run through GFC.
Canonical link: https://commits.webkit.org/316039@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications