Closed Bug 1895485 Opened 4 months ago Closed 4 months ago

width: calc(25% - 1em) calculates wrong in some situations (worked until FF 115)

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 125
defect

Tracking

()

RESOLVED DUPLICATE of bug 1893127

People

(Reporter: lubber, Unassigned)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

Steps to reproduce:

Minimal reproducable example code

.fourcolumns {
  display: flex;
  flex-wrap: wrap;
}
.fourcolumns .column {
  width: calc(25% - 1em);
  background: orange;
  margin: 0.875em 0.5em;
}
<div class="fourcolumns">
  <div class="column">
    Column
  </div>
  <div class="column">
    Column
  </div>
  <div class="column">
    Column
  </div>
  <div class="column">
    Column
  </div>
    <div class="column">
    Column
  </div>
</div>

Actual results:

Firefox 125 sometimes moves the fourth column into the second row. (will eventually happen when resizing the window)
Every browser (chromium based) and also Firefox <=115 displays 4 columns in the first row all the time as expected

Expected results:

four rows should be displayed all the time, regardless of viewport /window size

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

I can't seem to reproduce this; I tried on both macOS and Windows, and I'm consistently getting the expected 4 columns no matter how I resize the render panel.

The reported issue seems like it could be related to rounding errors in the computations somewhere, but if so, I don't know why I can't reproduce.

Marco, can you try with a new Firefox profile, and/or running in Troubleshoot Mode (see the Help menu), and confirm whether you still see the issue?

Flags: needinfo?(c64)

I just tried troubleshoot mode and the issue still persists.

BUT: I played with browser scaling (CTRL+/-/mousewheel) (i usually have 120% on my notebook).
When i switch to 100%, the issue does not seem to happen, but it does happen on 80%, 90%, 110%, 120% ...

Flags: needinfo?(c64)

Showing issue exists for scaling only

I think this is due to the patch for Bug 1881220 that landed in 125.0.
And the offending patch for Bug 1881220 has been backed out from beta126 and nightly127.0a1.

Thanks! I can confirm the issue is gone in FF Nightly 127.0a1

Status: UNCONFIRMED → RESOLVED
Closed: 4 months ago
Duplicate of bug: 1893127
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: