Title: [283321] trunk
Revision
283321
Author
z...@igalia.com
Date
2021-09-30 12:15:38 -0700 (Thu, 30 Sep 2021)

Log 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.

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (283320 => 283321)


--- trunk/LayoutTests/ChangeLog	2021-09-30 17:48:19 UTC (rev 283320)
+++ trunk/LayoutTests/ChangeLog	2021-09-30 19:15:38 UTC (rev 283321)
@@ -1,3 +1,14 @@
+2021-09-30  Ziran Sun  <z...@igalia.com>
+
+        [css-grid]  Transfer sizes from the aspect-ratio while resolving min-length for auto repetitions
+        https://bugs.webkit.org/show_bug.cgi?id=230676
+
+        Reviewed by Sergio Villar Senin.
+
+        Updated TestExpectations file as two tests with image failures are now passing.
+
+        * TestExpectations:
+
 2021-09-30  Arcady Goldmints-Orlov  <agoldmi...@igalia.com>
 
         [GLIB] Rebaseline a number of tests. Unreviewed test gardening.

Modified: trunk/LayoutTests/TestExpectations (283320 => 283321)


--- trunk/LayoutTests/TestExpectations	2021-09-30 17:48:19 UTC (rev 283320)
+++ trunk/LayoutTests/TestExpectations	2021-09-30 19:15:38 UTC (rev 283321)
@@ -1341,8 +1341,6 @@
 webkit.org/b/216146 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-baseline-align-001.html [ ImageOnlyFailure ]
 webkit.org/b/216146 imported/w3c/web-platform-tests/css/css-grid/alignment/grid-baseline-justify-001.html [ ImageOnlyFailure ]
 
-imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-aspect-ratio-001.html [ ImageOnlyFailure ]
-imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-aspect-ratio-002.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-dynamic-001.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-auto-repeat-dynamic-003.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-repeat-max-width-001.html [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (283320 => 283321)


--- trunk/Source/WebCore/ChangeLog	2021-09-30 17:48:19 UTC (rev 283320)
+++ trunk/Source/WebCore/ChangeLog	2021-09-30 19:15:38 UTC (rev 283321)
@@ -1,3 +1,17 @@
+2021-09-30  Ziran Sun  <z...@igalia.com>
+
+        [css-grid]  Transfer sizes from the aspect-ratio while resolving min-length for auto repetitions
+        https://bugs.webkit.org/show_bug.cgi?id=230676
+
+        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):
+
 2021-09-30  John Wilander  <wilan...@apple.com>
 
         PCM: Take app bundle ID into consideration when matching triggering events with pending clicks

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (283320 => 283321)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2021-09-30 17:48:19 UTC (rev 283320)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2021-09-30 19:15:38 UTC (rev 283321)
@@ -479,7 +479,10 @@
         }
 
         const Length& minSize = isRowAxis ? style().logicalMinWidth() : style().logicalMinHeight();
-        if (!availableMaxSize && !minSize.isSpecified())
+        const auto& minSizeForOrthogonalAxis = isRowAxis ? style().logicalMinHeight() : style().logicalMinWidth();
+        bool shouldComputeMinSizeFromAspectRatio = minSizeForOrthogonalAxis.isSpecified() && !shouldIgnoreAspectRatio();
+
+        if (!availableMaxSize && !minSize.isSpecified() && !shouldComputeMinSizeFromAspectRatio)
             return autoRepeatTrackListLength;
 
         std::optional<LayoutUnit> availableMinSize;
@@ -488,9 +491,12 @@
                 containingBlockAvailableSize = isRowAxis ? containingBlockLogicalWidthForContent() : containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding);
             LayoutUnit minSizeValue = valueForLength(minSize, containingBlockAvailableSize.value_or(LayoutUnit()));
             availableMinSize = isRowAxis ? adjustContentBoxLogicalWidthForBoxSizing(minSizeValue, minSize.type()) : adjustContentBoxLogicalHeightForBoxSizing(minSizeValue);
-            if (!maxSize.isSpecified())
-                needsToFulfillMinimumSize = true;
+        } else if (shouldComputeMinSizeFromAspectRatio) {
+            auto [logicalMinWidth, logicalMaxWidth] = computeMinMaxLogicalWidthFromAspectRatio();
+            availableMinSize = logicalMinWidth;
         }
+        if (!maxSize.isSpecified())
+            needsToFulfillMinimumSize = true;
 
         availableSize = std::max(availableMinSize.value_or(LayoutUnit()), availableMaxSize.value_or(LayoutUnit()));
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to