Closed Bug 1905736 Opened 3 months ago Closed 3 months ago

[css-values-4] Allow removal of unit in calc() by dividing with same type

Categories

(Core :: CSS Parsing and Computation, enhancement)

Firefox 127
enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1827404

People

(Reporter: kharelbarun, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

  1. Open the attached HTML file.
  2. Open Web Developer Tools
  3. Select "Inspector" tab
  4. Click the <body> element in the Inspector
  5. 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:

  1. https://github.com/w3c/csswg-drafts/issues/10511
  2. https://github.com/w3c/csswg-drafts/issues/545

Division and multiplication of values with units is already covered by bug 1827404.

Sebastian

Status: UNCONFIRMED → RESOLVED
Closed: 3 months ago
Duplicate of bug: 1827404
Resolution: --- → DUPLICATE

: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.

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

: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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: