Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3bdeec83c5f5bcda23a2844946913b3d45f14641
      
https://github.com/WebKit/WebKit/commit/3bdeec83c5f5bcda23a2844946913b3d45f14641
  Author: Elika Etemad <[email protected]>
  Date:   2026-01-08 (Thu, 08 Jan 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-lanes/tentative/abspos/column-grid-lanes-positioned-item-dynamic-change.html
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-lanes/tentative/track-sizing/grid-lanes-track-sizing-check-grid-height-on-resize.html
    M Source/WebCore/rendering/GridMasonryLayout.cpp
    M Source/WebCore/rendering/GridMasonryLayout.h
    M Source/WebCore/rendering/RenderGrid.cpp
    M Source/WebCore/rendering/RenderGrid.h

  Log Message:
  -----------
  Set containing block of grid-lanes items to container size in the stacking 
axis
https://bugs.webkit.org/show_bug.cgi?id=304715
rdar://167221488

Reviewed by Brandon Stewart.

Because grid items have a grid area in both axes, there are many places in the
grid code where we set its containing block to a grid area in both axes.
However the containing block of a grid-lanes item in the stacking axis is its
grid container, not a grid area. Trying to use a grid area results in
nonsensical item sizes in cases where the item size depends on the container
(e.g. fit-content, percentages).

This patch factors out the places where we try to set the item's containing
block and ensures we set it correctly in the stacking axis for grid-lanes items.

* LayoutTests/TestExpectations:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-lanes/tentative/abspos/column-grid-lanes-positioned-item-dynamic-change.html:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/grid-lanes/tentative/track-sizing/grid-lanes-track-sizing-check-grid-height-on-resize.html:
* LayoutTests/platform/mac/TestExpectations:
* Source/WebCore/rendering/GridMasonryLayout.cpp:
(WebCore::GridMasonryLayout::setItemContainingBlockToGridArea):
(WebCore::GridMasonryLayout::insertIntoGridAndLayoutItem):
(WebCore::GridMasonryLayout::setItemGridAxisContainingBlockToGridArea): Deleted.
* Source/WebCore/rendering/GridMasonryLayout.h:
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::selfAlignmentForGridItem const):
(WebCore::RenderGrid::performPreLayoutForGridItems const):
(WebCore::RenderGrid::updateGridAreaWithEstimate const):
(WebCore::RenderGrid::updateGridAreaIncludingAlignment const):
(WebCore::RenderGrid::updateGridAreaForAspectRatioItems):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::layoutMasonryItems):
(WebCore::RenderGrid::gridAreaBreadthForGridItemIncludingAlignmentOffsets 
const):
* Source/WebCore/rendering/RenderGrid.h:

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



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

Reply via email to