[webkit-changes] [WebKit/WebKit] b508fd: [css-grid] getBaselineChild should consider both f...

Sammy Gill noreply at github.com
Fri Sep 15 10:10:51 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b508fd690c0973b5824b82e26e6013e2b73b6470
      https://github.com/WebKit/WebKit/commit/b508fd690c0973b5824b82e26e6013e2b73b6470
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2023-09-15 (Fri, 15 Sep 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-grid-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-grid-002-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-grid-003-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-grid-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-grid-002-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-grid-003-expected.txt
    M Source/WebCore/rendering/GridLayoutFunctions.cpp
    M Source/WebCore/rendering/GridLayoutFunctions.h
    M Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
    M Source/WebCore/rendering/RenderGrid.cpp

  Log Message:
  -----------
  [css-grid] getBaselineChild should consider both first and last baseline aligned grid items.
https://bugs.webkit.org/show_bug.cgi?id=261523.
rdar://115441833.

Reviewed by Matt Woodrow.

getbaselineChild is responsible for selecting the correct grid item to
use when determining the baseline for the grid itself. The spec states:

The first (last) baselines of a grid container are determined as follows:
    1.) Find the first (last) row of the grid container containing at
        least one grid item.

    If any of the grid items intersecting this row participate in
    baseline alignment in that row, the grid containers baseline set is
    generated from the shared alignment baseline of those grid items.

Since the spec states that we should look for any grid items that
"participate in baseline alignment in that row" it seems like we should
also look at items that are being last baseline aligned.

In the case that an item spans multiple rows, we need to double check
the alignment context that it is participating in (which row) is the
same as the row we are using to determine the baseline (first row for
first baseline and last row for last baseline).

* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-grid-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-grid-002-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/alignment/flex-align-baseline-grid-003-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-grid-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-grid-002-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-grid-003-expected.txt:
* Source/WebCore/rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::alignmentContextForBaselineAlignment):
* Source/WebCore/rendering/GridLayoutFunctions.h:
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
(WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const):
(WebCore::alignmentContextForBaselineAlignment): Deleted.
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::getBaselineChild const):

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




More information about the webkit-changes mailing list