[webkit-changes] [WebKit/WebKit] ebd030: [css-grid] Accumulate nested subgrids' margin, bor...

Sammy Gill noreply at github.com
Thu Oct 5 16:19:05 PDT 2023


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

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

  Log Message:
  -----------
  [css-grid] Accumulate nested subgrids' margin, border, and padding to base size of outer grid tracks.
https://bugs.webkit.org/show_bug.cgi?id=260531
rdar://114271839

Reviewed by Matt Woodrow.

Currently, if there is a subgrid we will take the sum of its margin,
border, and padding (mbp) at each edge and apply it to the track sizing
algorithm for the track the edge is in. This sum may then get applied to
the base size of the track if needed.

However, if there are nested subgrids, we need to take them into account
and accumulate their values as well so that any adjacent chunks of mbp
are considered as a single layer when sizing the track.

We can accomplish this by keeping track of a variable that stores the
accumulated value as we recurse through nested subgrids. This value will
first be set to 0 in the first call to accumulateIntrinsicSizesForTrack.
As we iterate over the track's items, if we find a subgrid we will
compute the margin, border, and padding values it contributes to the
track and add it to the variable we are using to store the accumulated
value and potentially update the track size.

The key idea is that when we recurse into a new level of a nested
subgrid we will pass along and use this updated accumulated value with
the subgrid's mbp, but as we traverse through subgrids within the same
level will: use the same accumulated value, add the subgrid's mbp to
the value, and then potentially update the track size.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::computeSubgridMarginBorderPadding):
(WebCore::GridTrackSizingAlgorithm::accumulateIntrinsicSizesForTrack):
(WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes):
(WebCore::addSubgridMarginBorderPadding): Deleted.
* Source/WebCore/rendering/GridTrackSizingAlgorithm.h:

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




More information about the webkit-changes mailing list