[webkit-changes] [WebKit/WebKit] dedaa2: [css-grid] Anecstor subgrids' gutters should add t...

Sammy Gill noreply at github.com
Wed Oct 11 02:52:14 PDT 2023


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

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/GridLayoutFunctions.cpp
    M Source/WebCore/rendering/GridLayoutFunctions.h
    M Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp

  Log Message:
  -----------
  [css-grid] Anecstor subgrids' gutters should add to the extra layer of margin for descendant subgrids
https://bugs.webkit.org/show_bug.cgi?id=260532
rdar://114271857

Reviewed by Matt Woodrow.

268947 at main starts to accumulate the margin, border, and padding of
nested subgrids to act as a single layer of additional margin for the
track. This was needed for the specific scenario in which there were
subgrids without any items as for other types of grid items we would
walk back up the ancestor chain to compute this value. Subgrids are
treated differently so that behavior is not done and we needed this
extra change.

This patch aims to expand on the scenario by including the gutter sizes
from ancestor subgrids to this extra layer of margin. We can do this
by walking back up the ancestor chain to compute the total value of the
gutters that would act as an additional margin for items in the track.

This computation is only done if the subgrid's start/end position is one
of the lines of the track in the outer grid. Otherwise, this subgrid
spans *through* the track and cannot have the any gutters from subgrids
act as margins for this track.

Notably, we want to make sure that we do not add this value directly
to currentAccumulatedMbp and recurse into
accumulateIntrinsicSizesForTrack with it. We will compute this value
for each subgrid that acts as a grid item by walking up the ancestor
chain. This is because it is difficult to know ahead of time whether
a subgrid that is positioned in a track will have nested subgrids that
are also positioned in the same track and avoid adding the gutters
multiple times.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::hasRelativeOrIntrinsicSizeForChild):
* Source/WebCore/rendering/GridLayoutFunctions.h:
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::accumulateIntrinsicSizesForTrack):

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




More information about the webkit-changes mailing list