Open Bug 1737353 Opened 4 years ago Updated 2 years ago

WPT test flex-tracks-with-fractional-size.html test is failing on Firefox (due to rounding issues with `fr` units and large numbers of tracks)

Categories

(Core :: Layout: Grid, defect)

defect

Tracking

()

People

(Reporter: aanala, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; CrOS x86_64 14150.64.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.104 Safari/537.36

Steps to reproduce:

Below wpt test is failing on Firefox

external/wpt/css/css-grid/layout-algorithm/flex-tracks-with-fractional-size.html

https://crrev.com/929538
Cl: https://chromium-review.googlesource.com/c/chromium/src/+/3193674

Chromium Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1249750

Chrome test failure bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1102918

Webkit test failure bug: https://bugs.webkit.org/show_bug.cgi?id=232173

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Grid' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Layout: Grid
Product: Firefox → Core

The severity field is not set for this bug.
:dholbert, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(dholbert)

Direct link to test: https://wpt.live/css/css-grid/layout-algorithm/flex-tracks-with-fractional-size.html

There are two grids -- one called cols and one called rows -- and in both of them, Firefox shows a bit of red at the very end of the grid (at the top-right and bottom edge of the green square).

The first grid here has precisely 973 columns and the second has 973 rows; and they each have 973 grid items that are placed into those tracks. The tracks are sized using 1fr units (to divide up the space equally, or as equally as possible). So theoretically, the tracks should precisely fill the grid, and so the items should cover up the whole grid, and so no red should be visible.

The issue seems to be that Firefox is failing to precisely divide up the grid's space (100px of width / 50px of height) into 973 pieces, such that the whole area of the grid is divvied up.

If I adjust the testcase to use 600 as the magic number instead of 973 (which works nicely with our 60-app-units-per-pixel fixed-point conversion), then we pass just fine.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(dholbert)
Summary: external/wpt/css/css-grid/layout-algorithm/flex-tracks-with-fractional-size.html test is failing on Firefox → WPT test flex-tracks-with-fractional-size.html test is failing on Firefox (due to rounding issues with `fr` units and large numbers of tracks)

Actually, I don't think the dynamically-added grid items make a difference in the test. The green area that you see is actually just from the single grid item with "grid-column: 1 / -1" (orgrid-row`), which spans all of the tracks from start to end. The other elements have zero size (e.g. in #cols, they're as wide as the tiny columns, but they have zero height), so they do not render at all.

Here's a testcase showing how this looks with a variety of column-counts. The first three (1, 100, 500) all look fine; the last 3 (700, 800, 973) are all broken (800 is too wide and covers up the right border; 700 and 973 are too skinny and leave some red visible)

Flags: needinfo?(mats)

Aha, it looks like this is essentially an instance of bug 1201941 (i.e. known issue, though I'm not sure we had a concrete testcase until now).

Depends on: 1201941
Flags: needinfo?(mats)
Version: Firefox 93 → Trunk
Assignee: nobody → i.moz
Status: NEW → ASSIGNED
Assignee: i.moz → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: