Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a09df3a175d827276932c3a68fbfbbd4317710b8
https://github.com/WebKit/WebKit/commit/a09df3a175d827276932c3a68fbfbbd4317710b8
Author: Sammy Gill <[email protected]>
Date: 2025-12-02 (Tue, 02 Dec 2025)
Changed paths:
M Source/WebCore/layout/integration/LayoutIntegrationUtils.cpp
M Source/WebCore/layout/integration/LayoutIntegrationUtils.h
M Source/WebCore/layout/layouttree/LayoutBox.cpp
Log Message:
-----------
[LFC] Add API to get the preferred minimum and maximum widths of a box.
rdar://165634646
https://bugs.webkit.org/show_bug.cgi?id=303330
Reviewed by Alan Baradlay.
The grid track sizing algorithm may ask for a grid item's minimum and
maximum content contributions to use during track sizing.
https://drafts.csswg.org/css-grid-1/#algo-single-span-items
In RenderTree, this is done by calling into the preferred logical widths
API and using that value as the contribution (see
GridTrackSizingAlgorithmStrategy::minContentContributionForGridItem)
for the inline dimensions. Before we can add similar logic to GFC we
need to to have some sort of an equivalent API so in this patch we add a
couple more functions to LayoutIntegrationUtils to get these values to
keep behavior consistent with RenderTree.
Since only grid item's as of now will use this API, I added an ASSERT to
make sure this is valid when someone calls it. If someone wants to use
this for another purpose at some point in the future this should
hopefully make sure this is actually what they want, and as a result
modify the ASSERT, or help them realize they may want something else.
* Source/WebCore/layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::establishesIndependentFormattingContext const):
This is ASSERTed by formattingContextRootLogicalWidthForType so we need
to modify this since grid items also establish an independent
formatting context for their content.
Canonical link: https://commits.webkit.org/303760@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications