Closed
Bug 1867558
Opened 2 years ago
Closed 2 years ago
[css-values] abs(-0) should be +0 instead of -0
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
122 Branch
| Tracking | Status | |
|---|---|---|
| firefox122 | --- | fixed |
People
(Reporter: Oriol, Assigned: connor.pearson)
References
Details
(Keywords: good-first-bug)
Attachments
(1 file)
This is one of the failures that I detected in https://github.com/web-platform-tests/wpt/pull/43430
<!DOCTYPE html>
<script>
var el = document.documentElement;
el.style.zIndex = "calc(1 / abs(-0))";
el.textContent = getComputedStyle(el).zIndex;
</script>
Expected: a big positive number
Actual: -2147483648
As per https://drafts.csswg.org/css-values/#sign-funcs
The
abs(A)function contains one calculation A, and returns the absolute value of A, as the same type as the input: if A’s numeric value is positive or 0⁺, just A again; otherwise-1 * A.
leaf.map(|v| if v.is_zero() { v } else { v.abs() });
Just do the v.abs() unconditionally?
| Reporter | ||
Updated•2 years ago
|
Summary: abs(-0) should be +0 instead of -0 → [css-values] abs(-0) should be +0 instead of -0
| Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Assignee: nobody → connor.pearson
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a4cc8a5be7d4
abs(-0) should be +0 instead of -0. r=emilio
Updated•2 years ago
|
Severity: -- → S3
Comment 3•2 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox122:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•