Bug 230676 - [css-grid] Transfer sizes from the aspect-ratio while resolving min-length for auto repetitions
Summary: [css-grid] Transfer sizes from the aspect-ratio while resolving min-length f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zsun
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-23 01:35 PDT by zsun
Modified: 2021-09-30 12:15 PDT (History)
11 users (show)

See Also:


Attachments
Patch (4.85 KB, patch)
2021-09-23 01:52 PDT, zsun
no flags Details | Formatted Diff | Diff
Patch (4.92 KB, patch)
2021-09-29 04:42 PDT, zsun
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zsun 2021-09-23 01:35:28 PDT
When resolve min-length for auto repetitions, we need to consider transferred sizes from the aspect-ratio.
Comment 1 zsun 2021-09-23 01:52:35 PDT
Created attachment 439026 [details]
Patch
Comment 2 Sergio Villar Senin 2021-09-29 01:34:44 PDT
Comment on attachment 439026 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=439026&action=review

Nice fix

> Source/WebCore/rendering/RenderGrid.cpp:483
> +        const Length& minSizeForTheOtherAxis = isRowAxis ? style().logicalMinHeight() : style().logicalMinWidth();

You can just use auto&. Also regarding the name I prefer minSizeForOrthogonalAxis, we've been using the "orthogonal" term for grid and flex extensively.

> Source/WebCore/rendering/RenderGrid.cpp:484
> +        if (!availableMaxSize && (!minSize.isSpecified() && (!minSizeForTheOtherAxis.isSpecified() || shouldIgnoreAspectRatio())))

I think you can remove the parentheses just before !minSize.isSpecified(). Also I think we can refactor the last condition into a variable and use it here and bellow.

bool shouldComputeMinSizeFromAspectRatio = minSizeForTheOtherAxis.isSpecified() && !shouldIgnoreAspectRatio();

and then you'd use !shouldComputeMinSizeFromAspectRatio here and shouldComputeMinSizeAspectRatio in the else if block bellow.
Comment 3 Sergio Villar Senin 2021-09-29 01:35:15 PDT
Comment on attachment 439026 [details]
Patch

Forgot the r=me : )
Comment 4 zsun 2021-09-29 04:42:03 PDT
Created attachment 439593 [details]
Patch
Comment 5 Radar WebKit Bug Importer 2021-09-30 01:36:17 PDT
<rdar://problem/83708927>
Comment 6 EWS 2021-09-30 12:15:45 PDT
Committed r283321 (242346@main): <https://commits.webkit.org/242346@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439593 [details].