Changeset 291953 in webkit


Ignore:
Timestamp:
Mar 27, 2022 1:38:38 PM (4 months ago)
Author:
Matt Woodrow
Message:

Use the sizing algorithm's available size to compute grid gap.
https://bugs.webkit.org/show_bug.cgi?id=236956

Reviewed by Tim Nguyen.

Source/WebCore:

Computing the grid gap for subgridded tracks happens during the sizing algorithm
(as part of copying the sizes from the parent, instead of computing new sizes). At
this point we should always have a definite size available (the size of the tracks in
the parent that the subgrid spans), but it may not yet be set on the subgrid's RenderElement.
This retreives the size from the track sizing algorithm instead, where it should always be
available by this point.

  • rendering/GridTrackSizingAlgorithm.cpp:

(WebCore::GridTrackSizingAlgorithm::copyUsedTrackSizesForSubgrid):

LayoutTests:

Existing subgrid tests marked as passing.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r291952 r291953  
     12022-03-27  Matt Woodrow  <mattwoodrow@apple.com>
     2
     3        Use the sizing algorithm's available size to compute grid gap.
     4        https://bugs.webkit.org/show_bug.cgi?id=236956
     5
     6        Reviewed by Tim Nguyen.
     7
     8        * TestExpectations:
     9
     10        Existing subgrid tests marked as passing.
     11
    1122022-03-27  Matt Woodrow  <mattwoodrow@apple.com>
    213
  • trunk/LayoutTests/TestExpectations

    r291952 r291953  
    14171417
    14181418webkit.org/b/236959 imported/w3c/web-platform-tests/css/css-grid/subgrid/baseline-001.html [ ImageOnlyFailure ]
    1419 webkit.org/b/236956 imported/w3c/web-platform-tests/css/css-grid/subgrid/grid-gap-003.html [ ImageOnlyFailure ]
    14201419webkit.org/b/236958 imported/w3c/web-platform-tests/css/css-grid/subgrid/repeat-auto-fill-003.html [ ImageOnlyFailure ]
    14211420webkit.org/b/236949 imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-mbp-overflow-001.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r291952 r291953  
     12022-03-27  Matt Woodrow  <mattwoodrow@apple.com>
     2
     3        Use the sizing algorithm's available size to compute grid gap.
     4        https://bugs.webkit.org/show_bug.cgi?id=236956
     5
     6        Reviewed by Tim Nguyen.
     7
     8        Computing the grid gap for subgridded tracks happens during the sizing algorithm
     9        (as part of copying the sizes from the parent, instead of computing new sizes). At
     10        this point we should always have a definite size available (the size of the tracks in
     11        the parent that the subgrid spans), but it may not yet be set on the subgrid's RenderElement.
     12        This retreives the size from the track sizing algorithm instead, where it should always be
     13        available by this point.
     14
     15        * rendering/GridTrackSizingAlgorithm.cpp:
     16        (WebCore::GridTrackSizingAlgorithm::copyUsedTrackSizesForSubgrid):
     17
    1182022-03-27  Matt Woodrow  <mattwoodrow@apple.com>
    219
  • trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp

    r290879 r291953  
    15441544    removeSubgridMarginBorderPaddingFromTracks(allTracks, endMBP, false);
    15451545
    1546     LayoutUnit gapDifference = (m_renderGrid->gridGap(m_direction) - outer->gridGap(direction)) / 2;
     1546    LayoutUnit gapDifference = (m_renderGrid->gridGap(m_direction, availableSpace(m_direction)) - outer->gridGap(direction)) / 2;
    15471547    for (int i = 0; i < numTracks; i++) {
    15481548        LayoutUnit size = allTracks[i].baseSize();
Note: See TracChangeset for help on using the changeset viewer.