Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 510444e79edab669e220492cf1cc8d5575392e3f
      
https://github.com/WebKit/WebKit/commit/510444e79edab669e220492cf1cc8d5575392e3f
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-09-23 (Wed, 23 Sep 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-container-baseline-first-item-in-grid-order-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-container-baseline-first-item-in-grid-order.html
    M Source/WebCore/rendering/RenderGrid.cpp

  Log Message:
  -----------
  Grid container exports the wrong first/last baseline when multiple columns 
participate in baseline alignment
https://bugs.webkit.org/show_bug.cgi?id=324519
rdar://187757320

Reviewed by Sammy Gill.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

RenderGrid::baselineGridItem() walks the columns of the baseline-determining
row to find the grid item whose baseline the container exports. When an item
participated in baseline alignment it was assigned to the result and only the
inner (per-cell) loop was broken, so a later column that also participated
overwrote the choice. The container therefore exported the last participating
column's baseline instead of the first one in grid order.

Return the item as soon as a participating one is found so the first item in
grid order wins, while keeping the existing fallback to the first item overall
when nothing participates.

Test: 
imported/w3c/web-platform-tests/css/css-grid/alignment/grid-container-baseline-first-item-in-grid-order.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-container-baseline-first-item-in-grid-order-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-container-baseline-first-item-in-grid-order.html:
 Added.
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::baselineGridItem const):

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



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

Reply via email to