Skip to content

[GFC] Support fixed-length padding on grid items#69421

Open
yulunwu2 wants to merge 1 commit into
WebKit:mainfrom
yulunwu2:gfc-ungate-grid-item-padding-fixed
Open

[GFC] Support fixed-length padding on grid items#69421
yulunwu2 wants to merge 1 commit into
WebKit:mainfrom
yulunwu2:gfc-ungate-grid-item-padding-fixed

Conversation

@yulunwu2

@yulunwu2 yulunwu2 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

e2335b7

[GFC] Support fixed-length padding on grid items
https://bugs.webkit.org/show_bug.cgi?id=319430
<rdar://182249991>

Reviewed by NOBODY (OOPS!).

Narrow and rename the padding avoidance reason (now GridItemHasPercentOrCalcPadding)
so grid items whose padding is a fixed length (px, em, etc) use GFC instead of the
legacy RenderGrid.

Fixed-length padding is threaded into item and track sizing as part of the
item's border-box size, so it lays out identically to legacy RenderGrid.

Percentage and calc() padding remain on the legacy path for now.

* LayoutTests/fast/css-grid-layout/grid-item-with-em-padding-track-sizing-expected.txt: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-em-padding-track-sizing.html: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-and-percent-margin-expected.txt: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-and-percent-margin.html: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-intrinsic-track-sizing-expected.txt: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-intrinsic-track-sizing.html: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-track-sizing-expected.txt: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-track-sizing.html: Added.
* Source/WebCore/layout/integration/grid/LayoutIntegrationGridCoverage.cpp:
(WebCore::LayoutIntegration::gridLayoutAvoidanceReason):
(WebCore::LayoutIntegration::printReason):

e2335b7

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ⏳ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests ⏳ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 loading 🧪 api-mac ✅ 🧪 api-wpe ⏳ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ⏳ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
⏳ 🛠 ios-safer-cpp ⏳ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 vision-sim ⏳ 🧪 mac-intel-wk2 ⏳ 🛠 playstation
✅ 🧪 vision-wk2 ⏳ 🛠 mac-safer-cpp
✅ 🛠 tv ✅ 🧪 mac-site-isolation
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@yulunwu2 yulunwu2 self-assigned this Jul 14, 2026
@yulunwu2 yulunwu2 added the Layout and Rendering For bugs with layout and rendering of Web pages. label Jul 14, 2026
https://bugs.webkit.org/show_bug.cgi?id=319430
<rdar://182249991>

Reviewed by NOBODY (OOPS!).

Narrow and rename the padding avoidance reason (now GridItemHasPercentOrCalcPadding)
so grid items whose padding is a fixed length (px, em, etc) use GFC instead of the
legacy RenderGrid.

Fixed-length padding is threaded into item and track sizing as part of the
item's border-box size, so it lays out identically to legacy RenderGrid.

Percentage and calc() padding remain on the legacy path for now.

* LayoutTests/fast/css-grid-layout/grid-item-with-em-padding-track-sizing-expected.txt: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-em-padding-track-sizing.html: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-and-percent-margin-expected.txt: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-and-percent-margin.html: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-intrinsic-track-sizing-expected.txt: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-intrinsic-track-sizing.html: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-track-sizing-expected.txt: Added.
* LayoutTests/fast/css-grid-layout/grid-item-with-fixed-padding-track-sizing.html: Added.
* Source/WebCore/layout/integration/grid/LayoutIntegrationGridCoverage.cpp:
(WebCore::LayoutIntegration::gridLayoutAvoidanceReason):
(WebCore::LayoutIntegration::printReason):
@yulunwu2 yulunwu2 force-pushed the gfc-ungate-grid-item-padding-fixed branch from 9b8a457 to e2335b7 Compare July 15, 2026 00:47
@yulunwu2 yulunwu2 requested a review from sammygill July 15, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Layout and Rendering For bugs with layout and rendering of Web pages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants