New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 915190 link

Starred by 5 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

calc in Media Queries evaluates to a fixed value

Reported by gustvand...@gmail.com, Dec 14

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36

Steps to reproduce the problem:
Create a media-query that mixes static values like px and non-static values like vw or vh.

What is the expected behavior?
The calc function should remain a calc function and update when necessary.

What went wrong?
Chrome evaluates these values to a single, fixed value and doesn't update anytime.

Did this work before? N/A 

Does this work in other browsers? No
 As of now, this only works in Firefox.

Chrome version: 70.0.3538.110  Channel: n/a
OS Version: 10.0
Flash Version:
 
calc in MQ test.html
639 bytes View Download
I'm not a Chromium developer but I think the specification seems too lax to allow such queries:

  @media (max-width: calc(50vw + 400px))

Here's an arguably equivalent one that makes *physical* sense:

  @media (max-width: 800px)
Bisected to https://chromium.googlesource.com/chromium/blink/+log/6c963471..4034b1be
Suspecting 6a1cde43fa43029e2c8cc9680702234b23b016ab
"Move viewport unit resolution to style recalc time"
Landed in 34.0.1769.0 via r242882
Ignore the `html.red` rule, by the way, I accidentally left it in there after testing some things.
Labels: Needs-Triage-M70
Cc: andruud@chromium.org tabatkins@chromium.org
Status: Available (was: Unconfirmed)

Sign in to add a comment