[webkit-changes] [WebKit/WebKit] 2688e1: [css-grid] Use synthesizedBaseline to synthesize t...

Sammy Gill noreply at github.com
Fri Oct 27 10:25:01 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2688e1f33c192b78b77f2a49f787171cce7f6db1
      https://github.com/WebKit/WebKit/commit/2688e1f33c192b78b77f2a49f787171cce7f6db1
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2023-10-27 (Fri, 27 Oct 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-baseline-006-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-baseline-008-expected.txt
    M Source/WebCore/rendering/GridBaselineAlignment.cpp

  Log Message:
  -----------
  [css-grid] Use synthesizedBaseline to synthesize the correct baseline of grid items in the column axis.
https://bugs.webkit.org/show_bug.cgi?id=263600
rdar://problem/117424263

Reviewed by Alan Baradlay.

Currently GridBaselineAlignment::ascentForChild does not correctly
syntheisze the central baseline in certain situations. It appears that
the current code attempts to only synthesize the alphabetic baseline.
Accoring to the spec, alignment-baseline: baseline, which is the initial
value, refers to the box's parent's dominant-baseline, which is the
initial value of "auto," since we do not implement it yet either.
The description for "dominant-baseline: auto," says:

Equivalent to alphabetic in horizontal writing modes and in vertical
writing modes when text-orientation is sideways. Equivalent to central
in vertical writing modes when text-orientation is mixed or upright.

Instead of attempting to synthesize the baseline within grid layout
code, we can use synthesizedBaseline in RenderBox which synthesizes
a baseline value depending on the arguments it is given. This function
will compute the central baseline of the box in the scenarios that are
described above in the property value's description. We perform this
logic only when we are aligning in the column axis and fallback to
the old behavior for the row axis. Attempting to change this logic for
both at this time causes regressions so a closer look will be needed in
order to address that case in a separate patch.

* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-baseline-006-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-baseline-008-expected.txt:
* Source/WebCore/rendering/GridBaselineAlignment.cpp:
(WebCore::GridBaselineAlignment::ascentForChild const):

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




More information about the webkit-changes mailing list