Closed Bug 1860205 Opened 8 months ago Closed 8 months ago

CSS round(up, A, B) and round(down, A, B) order of operations incorrect (A multiplied by -1 before rounding)

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 118
defect

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: firefoxbugs, Assigned: jfkthame)

Details

Attachments

(2 files)

Steps to reproduce:

In addition to bug 1859048, the CSS round() function produces wrong answers when combined with further calculations.
examples:
calc(0px - round(up, 1.9px, 1px))
calc(0px - round(down, 1.1px, 1px))

Actual results:

The first yields -1px.
The second yields -2px.

Expected results:

Obviously, the first should be -2px and the second should be -1px.

Somehow it seems like the values are escaping parentheses and being evaluated out of order.

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

For more information, please visit BugBot documentation.

Flags: needinfo?(jfkthame)
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(jfkthame)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/db7079f00408
Swap Up/Down rounding strategy when negating a Round calc node. r=firefox-style-system-reviewers,emilio
https://hg.mozilla.org/integration/autoland/rev/e7a1cc464f70
Add tests for negation of a round() node. r=firefox-style-system-reviewers,emilio
Failed to create upstream wpt PR due to merge conflicts. This requires fixup from a wpt sync admin.
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42962 for changes under testing/web-platform/tests
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: