Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2eeda48d71f8ae284c198094b9387dc6ad35d1d5
      
https://github.com/WebKit/WebKit/commit/2eeda48d71f8ae284c198094b9387dc6ad35d1d5
  Author: Yulun Wu <[email protected]>
  Date:   2026-09-16 (Wed, 16 Sep 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-border-padding-005-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-border-padding-005-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-border-padding-005.html
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp

  Log Message:
  -----------
  [GFC] Floor grid items' content box size to zero.
https://bugs.webkit.org/show_bug.cgi?id=324377
rdar://187612019

Reviewed by Sammy Gill.

This PR fixes a bug where a stretched grid item whose padding
exceeds its grid area is sized to a negative content box.

stretchFitSize() subtracts the item's margins, border, and padding from the 
available space without
a floor. Adding the border and padding back cancels the negative exactly, so 
the item's border box
comes out as the grid area size rather than the padding sum, leaving it 
narrower than its own
padding.

A content box cannot be negative, so clamp it to zero. The item then stretches 
to a zero content
box and overflows its grid area, which is what legacy RenderGrid and Blink both 
produce.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-border-padding-005-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-border-padding-005-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-item-border-padding-005.html:
 Added.
* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp:
(WebCore::Layout::stretchFitSize):

Canonical link: https://commits.webkit.org/321295@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to