Support mixed number, unit value, and percent for calc() parser including type checking
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
People
(Reporter: boris, Assigned: sajidanwar)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-needed, parity-chrome, parity-safari)
| Reporter | ||
Updated•10 years ago
|
Comment 3•10 years ago
|
||
Updated•9 years ago
|
Updated•9 years ago
|
Comment 4•8 years ago
|
||
Comment 6•4 years ago
|
||
Does this bug cover type checking as defined in CSS Values 4? I.e. will it be used to cover unit algebra with multiplication and division like calc(3rem / 2rem)?
Sebastian
| Reporter | ||
Comment 7•4 years ago
|
||
This bug was filed for the legacy implementation of calc(). Now we are using Rust to parse calc(), so I think we definitely can extend this bug to cover the case you mentioned (i.e. including all the type checking for calc()). Feel free to update the title if needed.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 8•5 months ago
|
||
Hi! I had a use for this recently: I wanted to use this on a page to fade out a decorative element (using opacity) based on the viewport width. For that to work I would need to use a calc with the pagelength and divide it and get a unitless number. This is supported in other web browsers
Comment 9•5 months ago
|
||
There's some relevant work ongoing in bug 2035572.
Comment 10•3 months ago
|
||
Part of :janv's Typed OM work (Bug 2046802) does a lot of similar (Identical?) work that hopefully we can reuse.
| Assignee | ||
Updated•2 months ago
|
| Assignee | ||
Comment 11•1 month ago
|
||
Going to close this as a duplicate of Bug 1827404, which is where typed arithmetic has been implemented behind a pref for now. (Also because the calc(1 + 2px) example which was the original source of this bug is explicitly disallowed by the spec.)
Description
•