New issue
Advanced search Search tips

Issue 843584 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

calc in media queries does not sum different units correctly

Reported by steve.ge...@gmail.com, May 16 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36

Steps to reproduce the problem:
1. Create a media query that uses a calc that sums em and px

What is the expected behavior?
That em are converted to px when added.

What went wrong?
em are not converted to px – they just are summed as is.

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 66.0.3359.139  Channel: n/a
OS Version: OS X 10.12.6
Flash Version: 

Tested on canary as well.
 
test-media-issue.html
435 bytes View Download
Labels: Needs-Triage-M66

Comment 2 by cnardi@chromium.org, May 16 2018

Labels: -OS-Mac
Owner: cnardi@chromium.org
Status: Assigned (was: Unconfirmed)
Confirmed, works correctly in Firefox. I'll take a look.

Comment 3 by cnardi@chromium.org, May 16 2018

Labels: -Needs-Triage-M66

Comment 4 by cnardi@chromium.org, May 18 2018

Cc: cnardi@chromium.org
 Issue 844565  has been merged into this issue.

Comment 5 by cnardi@chromium.org, May 18 2018

So this is because we only save a value and unit after parsing a media query. We really should be saving a CSSPrimitiveValue, as there are cases like this where we cannot determine a "computed" length at parse time.

Comment 6 by cnardi@chromium.org, May 18 2018

Cc: futhark@chromium.org
Hm, I have a WIP patch but I'm not sure how to proceed. In order for this proposal to happen, MediaQueryExpValue needs to store a pointer to a CSSPrimitiveValue, but since CSSPrimitiveValue is GC-managed, this creates all sorts of chaos.

Rune, any thoughts? I can't think of a better solution, since we need to have the CSSPrimitiveValue for evaluating the media query expression in cases like this. However, I have little experience with Olipan, so I'm not sure what would make this work.
Digging deeper into this, it seems like we need to have a CSSPrimitiveValue, which means everything has to have a trace method. Rune, can you confirm this, or is there any way to simplify the process of adding a GC-managed object?
Sounds reasonanble to have MediaQueryExp traced. MediaQueryExp is not new'ed atm, and I don't think you need to in order to have them trace CSS values either. I don't remember the exact way of doing that. I'd have to look up the oilpan docs.

Owner: ----
Status: Available (was: Assigned)
Unassigning this, I couldn't really figure out how to get it to work with Oilpan that well. I have an old WIP commit that I can show if anyone needs a start.
I was running into a problem that seems to meet this bug's description prior to updating to version 68.0.3440.106. After the update the problem went away, so may be fixed. Unfortunately I don't know what version I was on before the update.

Sign in to add a comment