Closed Bug 1391120 Opened 7 years ago Closed 7 years ago

stylo: Calc with negative values on the right side serializes with "+"

Categories

(Core :: CSS Parsing and Computation, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
Tracking Status
firefox57 --- fixed

People

(Reporter: canova, Assigned: emilio)

References

()

Details

<div style="width: calc(2px - 100%)"></div> <script>alert(document.querySelector('div').style.width)</script> This testcase prints "calc(2px + -100%)" on stylo. Both firefox and chrome prints "calc(2px - 100%)". This is not wrong, it is valid calc value, but definitely weird. We should do the same with other browsers here.
Priority: -- → P3
Just for the record, this comes from bug 1390496 comment 6.
See Also: → 1390496
Priority: P3 → P2
With the fix in https://github.com/servo/servo/pull/18131 (which has been merged to m-c https://hg.mozilla.org/mozilla-central/rev/c7832d380dce), now the testcase in comment 0 prints "calc(-100% + 2px)" on stylo. Is this difference between stylo and other browsers is expected? If so, then we can resolve this bug.
Flags: needinfo?(emilio+bugs)
Yeah, it's intentional per the issue you linked.
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(emilio+bugs)
Resolution: --- → FIXED
Assignee: nobody → emilio+bugs
You need to log in before you can comment on or make changes to this bug.