calc in media queries does not sum different units correctly
Reported by
steve.ge...@gmail.com,
May 16 2018
|
|||||
Issue descriptionUserAgent: 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.
,
May 16 2018
Confirmed, works correctly in Firefox. I'll take a look.
,
May 16 2018
,
May 18 2018
,
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.
,
May 18 2018
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.
,
Jun 1 2018
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?
,
Jun 4 2018
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.
,
Jul 12
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.
,
Aug 9
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 |
|||||
Comment 1 by viswa.karala@chromium.org
, May 16 2018