Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 97a5bd9e0b2f04147505f27846e56d28ae0da153
https://github.com/WebKit/WebKit/commit/97a5bd9e0b2f04147505f27846e56d28ae0da153
Author: Sammy Gill <[email protected]>
Date: 2026-09-25 (Fri, 25 Sep 2026)
Changed paths:
A LayoutTests/fast/repaint/grid-fit-content-item-layout-passes-expected.txt
A LayoutTests/fast/repaint/grid-fit-content-item-layout-passes.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
Log Message:
-----------
[GFC] Take a grid item's fit-content block size from its layout rather than
measuring it separately.
https://bugs.webkit.org/show_bug.cgi?id=325190
rdar://problem/188323159
Reviewed by Alan Baradlay.
Depending on a grid item's style its used block size might come from its
fit-content size. Currently this is handled by blockPreferredSize which
does two layouts: one for the min-content height and one for the
max-content height. This ends up resulting in more work than needed when
compared with RenderGrid. In this case RenderGrid ends up just
performing a single layout on the item which is the final layout at the
end of grid layout.
In this patch we change the GFC behavior to match RenderGrid since this
was observable in the different repaint tests. We check to see if the
grid item's height comes from the fit-content size and if that is the
case we just run a single layout on it like what RenderGrid does and get
the used block size from the output of that layout.
* LayoutTests/fast/repaint/grid-fit-content-item-layout-passes.html: Added.
* LayoutTests/fast/repaint/grid-fit-content-item-layout-passes-expected.txt:
Added.
This test tracks the repaints that are issued in this type of scenario
and is the same with GFC disabled as well.
Canonical link: https://commits.webkit.org/321914@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications