[webkit-changes] [WebKit/WebKit] d93507: [css-grid] Start considering subgrid's margin, bor...

Sammy Gill noreply at github.com
Tue Oct 3 14:57:32 PDT 2023


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

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/align-self-baseline-with-subgrid-mbp-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/align-self-baseline-with-subgrid-mbp.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-baseline-005-expected.txt
    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-007-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-baseline-008-expected.txt
    A LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-grid/subgrid/align-self-baseline-with-subgrid-mbp-expected.txt
    M Source/WebCore/rendering/GridBaselineAlignment.cpp

  Log Message:
  -----------
  [css-grid] Start considering subgrid's margin, border, and padding for align-self baseline items.
https://bugs.webkit.org/show_bug.cgi?id=262336
rdar://problem/116206243

Reviewed by Matt Woodrow.

For baseline alignment we currently do not consider the extra layer of
margin imposed by a subgrid's margin, border, and padding on a subgrid
item. For the purposes of baseline alignment this extra layer can
influence the ascent of a subgrid item.

This patch is a first step in towards considering these values for the
purposes of baseline alignment. We start with the most simple case where
we have a non-orthogonal and one level deep subgrid. We will want to
add additional patches to consider the scenarios where subgrids start
nesting and possibly even switch writing modes.

We can compute this "subgrid offset," when we compute the ascent value
for a grid item by checking to see if its parent is a subgrid in
ascentForChild. As a result, this means that the ascent value for a
subgrid item will always be relative to parent (non-subgrid) grid.

We will bail out of this computation and ultimately fall back to the old
behavior in any of the following conditions:
- The subgrid is orthogonal to its parent
- The baseline axis is the row axis (e.g. justify-self: baseline)
- The alignment is last baseline alignment

* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/align-self-baseline-with-subgrid-mbp-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/align-self-baseline-with-subgrid-mbp.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-baseline-005-expected.txt:
* 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-007-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-baseline-008-expected.txt:
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-grid/subgrid/align-self-baseline-with-subgrid-mbp-expected.txt: Added.
* Source/WebCore/rendering/GridBaselineAlignment.cpp:
(WebCore::GridBaselineAlignment::ascentForChild const):

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




More information about the webkit-changes mailing list