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

RESOLVED FIXED

Status

()

Core
CSS Parsing and Computation
P2
normal
RESOLVED FIXED
10 months ago
9 months ago

People

(Reporter: canaltinova, Assigned: emilio)

Tracking

(Blocks: 1 bug)

unspecified
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

(URL)

(Reporter)

Description

10 months ago
<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.

Updated

10 months ago
Priority: -- → P3
(Assignee)

Comment 1

10 months ago
Just for the record, this comes from bug 1390496 comment 6.
(Assignee)

Updated

10 months ago
See Also: → bug 1390496

Updated

10 months ago
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)
(Assignee)

Comment 3

10 months ago
Yeah, it's intentional per the issue you linked.
Status: NEW → RESOLVED
Last Resolved: 10 months ago
Flags: needinfo?(emilio+bugs)
Resolution: --- → FIXED
Assignee: nobody → emilio+bugs
status-firefox57: --- → fixed
You need to log in before you can comment on or make changes to this bug.