[css-values-4] Allow removal of unit in calc() by dividing with same type
Categories
(Core :: CSS Parsing and Computation, enhancement)
Tracking
()
People
(Reporter: kharelbarun, Unassigned)
Details
Attachments
(1 file)
1.50 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0
Steps to reproduce:
- Open the attached HTML file.
- Open Web Developer Tools
- Select "Inspector" tab
- Click the <body> element in the Inspector
- Select "Rules" tab in the right side pane in Inspector
At the top, there is "zoom" property applied through "style" attribute in body element. Its value is number (for example 1.424, or 4.93333). This is added using JavaScript in the <script> element at the end.
At the bottom, there is also another "zoom" property applied through <style> element. Its value is: calc(100vw / 375px). The first zoom property has to be unchecked for this to be applied.
What I am trying to achieve is to use zoom property in such a way that computed value of zoom is 1 when viewport width is 375px, and it increases or decreases when width of viewport increases or decreases respectively.
Currently, "resize" event is used in JavaScript to update the value of zoom property. Once it is possible to remove unit from calc(), there is no need of JavaScript to do so.
Actual results:
The zoom: calc(100vw / 375px) does not work even after the another zoom property (applied through style attribute) is unchecked. Firefox shows yellow triangle with exclamation and shows "Invalid property value" when hovered.
Expected results:
The zoom: calc(100vw / 375px) should work as the current CSS spec allows multiplication and division of dimensions (https://drafts.csswg.org/css-values-4/#calc-type-checking, https://drafts.csswg.org/css-values-4/#additions-L3).
Relevant links:
Comment 1•3 months ago
|
||
Division and multiplication of values with units is already covered by bug 1827404.
Sebastian
Reporter | ||
Comment 2•3 months ago
|
||
:sebo Thanks for marking this as duplicate of another bug.
But, due to the RESOLVED status, I cannot see this bug when searching for "removal of unit in calc" in search box in the navbar.
I can only see this bug in advanced search but it is difficult to choose correct options to get the result in few tries.
I think it is useful to not mark this as RESOLVED.
Comment 3•3 months ago
|
||
I've adjusted the summary of the other bug, so it can be found more easily. No need to reopen this one.
Note that you're now also on the CC list for that bug, so you won't miss any updates.
Sebastian
Reporter | ||
Comment 4•3 months ago
|
||
:sebo Thanks. Now, I can see the original bug when searching.
Bugzilla really need to have an easy way to search resolved bugs similar to how Github allows to search Closed or All Issues.
This way, we don't have to make description of the original bug more verbose.
Description
•