Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 04390f8f4dde2cbb5a70d9d04ed5ffc4bb360f14
      
https://github.com/WebKit/WebKit/commit/04390f8f4dde2cbb5a70d9d04ed5ffc4bb360f14
  Author: Alan Baradlay <[email protected]>
  Date:   2026-08-30 (Sun, 30 Aug 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-single-item-001-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-single-item-001.html
    M Source/WebCore/rendering/GridBaselineAlignment.cpp
    M Source/WebCore/rendering/GridBaselineAlignment.h

  Log Message:
  -----------
  REGRESSION(316706@main) tess.oconnor.cx: lots of spacing between image and 
content towards bottom of page
https://bugs.webkit.org/show_bug.cgi?id=322875
rdar://186102748

Reviewed by Antti Koivisto.

316706@main dropped the BaselineGroup::computeSize() > 1 guard from 
baselineOffsetForGridItem() on the assumption
that a single participant's max ascent is its own ascent, so that the offset is 
already zero.
That only holds while the ascent is stable: it is collected in 
computeBaselineAlignmentContext()
and computed again when the offset is queried. An item whose used size is only 
resolved after track sizing
(e.g. a replaced item with a percentage max-width) reports a smaller ascent by 
then, and the stale, larger max ascent turns into
a baseline offset that pushes the single item away from the start of its grid 
area.

Track the number of alignment subjects next to the max ascent in 
GridBaselineAlignment's per-context state and restore the guard (similar to 
what we had before 316706@main).

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-single-item-001-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-single-item-001.html:
 Added.
* Source/WebCore/rendering/GridBaselineAlignment.cpp:
(WebCore::GridBaselineAlignment::updateBaselineAlignmentContext):
(WebCore::GridBaselineAlignment::baselineOffsetForGridItem const):
* Source/WebCore/rendering/GridBaselineAlignment.h:

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



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

Reply via email to