Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e9a9f1b34ebcfffc202353153c28a419fa8f63c6
https://github.com/WebKit/WebKit/commit/e9a9f1b34ebcfffc202353153c28a419fa8f63c6
Author: Yulun Wu <[email protected]>
Date: 2026-05-19 (Tue, 19 May 2026)
Changed paths:
A
LayoutTests/fast/grid/grid-item-block-content-size-suggestion-crash-expected.txt
A LayoutTests/fast/grid/grid-item-block-content-size-suggestion-crash.html
M Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp
M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp
M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.h
M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp
M Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.h
M Source/WebCore/layout/integration/LayoutIntegrationUtils.cpp
M Source/WebCore/layout/integration/LayoutIntegrationUtils.h
Log Message:
-----------
[GFC][Crash] Grid items with auto height triggering a crash in
blockContentSizeSuggestion()
https://bugs.webkit.org/show_bug.cgi?id=314371
<rdar://176527830>
Reviewed by Sammy Gill.
Grid items with auto height are hitting ASSERT_NOT_IMPLEMENTED_YET
in blockSpecifiedSizeSuggestion(). This assert is not needed.
blockSpecifiedSizeSuggestion() and inlineSpecifiedSizeSuggestion()
are implemented per spec as indefinite preferred size is undefined.
This PR explicitly allows preferredSize() auto and updates the
documentation explaining why this is the case.
Fixing that exposed another crash in blockContentSizeSuggestion() which
called integrationUtils::minContentHeight().
integrationUtils::minContentHeight() is problematic here because it is fetching
a cached intrinsic content logical height that was saved by flex layout.
This isn't applicable for RenderBox() as finding the height for a RenderBox()
requires a width constraint to resolve. We should instead run layout() on the
grid item with the inlineAxisConstraint to resolve the block size for the grid
item.
This PR introduces an overloaded minContentHeight() method that takes
inline constraints and supports grid items.
*
LayoutTests/fast/grid/grid-item-block-content-size-suggestion-crash-expected.txt:
Added.
* LayoutTests/fast/grid/grid-item-block-content-size-suggestion-crash.html:
Added.
* Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp:
(WebCore::Layout::GridLayout::layoutGridItems const):
* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp:
(WebCore::Layout::GridLayoutUtils::inlineSpecifiedSizeSuggestion):
(WebCore::Layout::GridLayoutUtils::blockSpecifiedSizeSuggestion):
(WebCore::Layout::GridLayoutUtils::blockContentSizeSuggestion):
(WebCore::Layout::GridLayoutUtils::automaticMinimumBlockSize):
(WebCore::Layout::GridLayoutUtils::usedBlockSizeForGridItem):
(WebCore::Layout::GridLayoutUtils::usedBlockMinimumSize):
(WebCore::Layout::GridLayoutUtils::inlineAxisGridItemSizingFunctions):
(WebCore::Layout::GridLayoutUtils::blockAxisGridItemSizingFunctions):
* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.h:
* Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.cpp:
(WebCore::Layout::minimumContributions):
* Source/WebCore/layout/formattingContexts/grid/TrackSizingAlgorithm.h:
(WebCore::Layout::GridItemSizingFunctions::GridItemSizingFunctions):
* Source/WebCore/layout/integration/LayoutIntegrationUtils.cpp:
(WebCore::Layout::IntegrationUtils::minContentHeight const):
* Source/WebCore/layout/integration/LayoutIntegrationUtils.h:
Canonical link: https://commits.webkit.org/313478@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications