Bug 182922 - [css-grid] Incorrect calculation of repeat() with multiple values, auto-fill and grid-gap
Summary: [css-grid] Incorrect calculation of repeat() with multiple values, auto-fill ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Oriol Brufau
Keywords: InRadar
Depends on:
Reported: 2018-02-19 01:49 PST by Roman Komarov
Modified: 2020-05-20 13:25 PDT (History)
14 users (show)

See Also:

Screenshot of the bug (86.82 KB, image/png)
2018-02-19 01:49 PST, Roman Komarov
no flags Details
Patch (11.68 KB, patch)
2020-05-20 11:38 PDT, Oriol Brufau
no flags Details | Formatted Diff | Diff
Patch (11.74 KB, patch)
2020-05-20 12:55 PDT, Oriol Brufau
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Komarov 2018-02-19 01:49:40 PST
Created attachment 334146 [details]
Screenshot of the bug

Steps to reproduce the problem:

1. Go to https://codepen.io/kizu/pen/paayMm?editors=1100
2. Resize the viewport
3. Look at second example

What is the expected behavior?
The second example (the one with the bigger grid-gap) should work as well as the first one

What went wrong?
For some viewport values the width of the second example is calculated incorrectly, so there is a scrollbar created for the page and the layout looks broken.

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 62.0.3202.94  Channel: n/a
OS Version: OS X 10.13.2
Flash Version: 

The bigger the grid-gap, the bigger the problem, the first example at the codepen is also buggy, but as the grid-gap is very small, its almost unnoticable.

Other browsers: Edge works properly in all cases, but Firefox doesn't support multiple values at repeat() with auto-fill at all — https://bugzilla.mozilla.org/show_bug.cgi?id=1341507
Comment 1 Carlos Alberto Lopez Perez 2020-03-31 03:58:01 PDT
This very same issue was reported for Chromium at https://crbug.com/813511 (already fixed)
Comment 2 Carlos Alberto Lopez Perez 2020-03-31 04:01:26 PDT
A test case for this its available on WPT: http://wpt.live/css/css-grid/grid-definition/grid-auto-repeat-multiple-values-001.html
Comment 3 Oriol Brufau 2020-05-20 11:38:01 PDT
Created attachment 399861 [details]
Comment 4 Manuel Rego Casasnovas 2020-05-20 12:48:56 PDT
Comment on attachment 399861 [details]

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


> Source/WebCore/ChangeLog:15
> +        This patch modifies two places that relates to the gaps between the

Nit: s/relates/relate/
Comment 5 Oriol Brufau 2020-05-20 12:55:59 PDT
Created attachment 399878 [details]
Comment 6 EWS 2020-05-20 13:24:56 PDT
Committed r261949: <https://trac.webkit.org/changeset/261949>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399878 [details].
Comment 7 Radar WebKit Bug Importer 2020-05-20 13:25:13 PDT