⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283321 in webkit


Ignore:
Timestamp:
Sep 30, 2021, 12:15:38 PM (5 years ago)
Author:
Ziran Sun
Message:

[css-grid] Transfer sizes from the aspect-ratio while resolving min-length for auto repetitions
https://bugs.webkit.org/show_bug.cgi?id=230676

Source/WebCore:

Reviewed by Sergio Villar Senin.

When resolving min-length for auto repetitions, if the min-length on the axis considered is not specified,
we need to check if the min-length on the other axis and the aspect ratio are specified. When both are
specified, we will fetch the transferred min-length for the axis we are considering.

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::computeAutoRepeatTracksCount const):

LayoutTests:

Reviewed by Sergio Villar Senin.

Updated TestExpectations file as two tests with image failures are now passing.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r283318 r283321  
     12021-09-30  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-grid]  Transfer sizes from the aspect-ratio while resolving min-length for auto repetitions
     4        https://bugs.webkit.org/show_bug.cgi?id=230676
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Updated TestExpectations file as two tests with image failures are now passing.
     9
     10        * TestExpectations:
     11
    1122021-09-30  Arcady Goldmints-Orlov  <agoldmints@igalia.com>
    213
  • trunk/LayoutTests/TestExpectations

    r283307 r283321  
    13421342webkit.org/b/216146 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-baseline-justify-001.html [ ImageOnlyFailure ]
    13431343
    1344 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-aspect-ratio-001.html [ ImageOnlyFailure ]
    1345 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-aspect-ratio-002.html [ ImageOnlyFailure ]
    13461344imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-dynamic-001.html [ ImageOnlyFailure ]
    13471345imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-dynamic-003.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r283316 r283321  
     12021-09-30  Ziran Sun  <zsun@igalia.com>
     2
     3        [css-grid]  Transfer sizes from the aspect-ratio while resolving min-length for auto repetitions
     4        https://bugs.webkit.org/show_bug.cgi?id=230676
     5
     6        Reviewed by  Sergio Villar Senin.
     7       
     8        When resolving min-length for auto repetitions, if the min-length on the axis considered is not specified,
     9        we need to check if the min-length on the other axis and the aspect ratio are specified. When both are
     10        specified, we will fetch the transferred min-length for the axis we are considering.
     11
     12        * rendering/RenderGrid.cpp:
     13        (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
     14
    1152021-09-30  John Wilander  <wilander@apple.com>
    216
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r282804 r283321  
    480480
    481481        const Length& minSize = isRowAxis ? style().logicalMinWidth() : style().logicalMinHeight();
    482         if (!availableMaxSize && !minSize.isSpecified())
     482        const auto& minSizeForOrthogonalAxis = isRowAxis ? style().logicalMinHeight() : style().logicalMinWidth();
     483        bool shouldComputeMinSizeFromAspectRatio = minSizeForOrthogonalAxis.isSpecified() && !shouldIgnoreAspectRatio();
     484
     485        if (!availableMaxSize && !minSize.isSpecified() && !shouldComputeMinSizeFromAspectRatio)
    483486            return autoRepeatTrackListLength;
    484487
     
    489492            LayoutUnit minSizeValue = valueForLength(minSize, containingBlockAvailableSize.value_or(LayoutUnit()));
    490493            availableMinSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(minSizeValue, minSize.type()) : adjustContentBoxLogicalHeightForBoxSizing(minSizeValue);
    491             if (!maxSize.isSpecified())
    492                 needsToFulfillMinimumSize = true;
    493         }
     494        } else if (shouldComputeMinSizeFromAspectRatio) {
     495            auto [logicalMinWidth, logicalMaxWidth] = computeMinMaxLogicalWidthFromAspectRatio();
     496            availableMinSize = logicalMinWidth;
     497        }
     498        if (!maxSize.isSpecified())
     499            needsToFulfillMinimumSize = true;
    494500
    495501        availableSize = std::max(availableMinSize.value_or(LayoutUnit()), availableMaxSize.value_or(LayoutUnit()));
Note: See TracChangeset for help on using the changeset viewer.