Invalid CSS abs() subtraction
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox119 | --- | wontfix |
firefox120 | --- | wontfix |
firefox121 | --- | fixed |
People
(Reporter: bali, Assigned: tlouw)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Steps to reproduce:
transform: translateX(calc(100px - abs(100px)));
Example JSFiddle: https://jsfiddle.net/d4zk3has/
Actual results:
The element is translated by 200px to the right, as if the following was used:
calc(100px + abs(-100px))
Expected results:
The element should not be translated horizontally (the result of the operation should be 0px).
A current workaround is to multiply by -1:
calc(100px + -1 * abs(100px))
Comment 1•11 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•11 months ago
|
||
Indeed, negate()
for Abs
is incorrect here. Tiaan, do you have cycles to look? Presumably we can just wrap_in_negate
. Let me know if not and I can look myself.
Kind of surprised no tests fail due to this.
Comment 3•11 months ago
|
||
Set release status flags based on info from the regressing bug 1838600
Updated•11 months ago
|
Assignee | ||
Updated•11 months ago
|
Updated•11 months ago
|
Assignee | ||
Comment 4•11 months ago
|
||
The abs() function is not distributive, so should be wrapped in a negate
node rather than negating its child during simplification. E.g.:
10 - abs(10) != 10 + abs(-10)
Updated•11 months ago
|
Comment 7•11 months ago
|
||
bugherder |
Comment 9•11 months ago
|
||
The patch landed in nightly and beta is affected.
:tlouw, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- If no, please set
status-firefox120
towontfix
.
For more information, please visit BugBot documentation.
Assignee | ||
Updated•11 months ago
|
Assignee | ||
Updated•11 months ago
|
Description
•