[webkit-changes] [WebKit/WebKit] 256590: [css-grid] Consider fallback alignment for first/l...

Sammy Gill noreply at github.com
Fri Sep 8 14:50:51 PDT 2023


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

  Changed paths:
    M LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional-expected.txt
    M LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-002-expected.txt
    M Source/WebCore/rendering/RenderGrid.cpp

  Log Message:
  -----------
  [css-grid] Consider fallback alignment for first/last baseline when determining non-orthogonal grid item's columnAxisPosition.
https://bugs.webkit.org/show_bug.cgi?id=261290
rdar://problem/115136343

Reviewed by Matt Woodrow.

columnAxisPositionForChild maps first baseline to GridAxisStart and
last baseline to GridAxisEnd. This does not work in all cases, such as
when the grid item has an opposite block flow direction from the grid
container. In these cases the fallback alignment is flipped from these
values, so we should take this scenario into consideration.

We only need to apply this logic for non-orthogonal children as
orthogonal children will use the grid's writing mode (since the
alignment context is perpendicular to the grid's block flow direction).

fast/css-grid-layout/grid-self-baseline-two-dimensional had subtests
that were incorrect as they did not take certain things into account
like fallback alignment. I rebased these to match Blink's output as
that seems to match the spec.

https://drafts.csswg.org/css-align-3/#baseline-rules
https://drafts.csswg.org/css-align-3/#align-by-baseline

* LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional-expected.txt:
* LayoutTests/fast/css-grid-layout/grid-self-baseline-two-dimensional.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/alignment/grid-align-baseline-002-expected.txt:
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForChild const):

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




More information about the webkit-changes mailing list