CSS media queries broken in HTML imports
Reported by
a...@scirra.com,
Jan 3 2017
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2970.0 Safari/537.36 Steps to reproduce the problem: 1. Visit https://www.scirra.com/labs/bugs/mediabug/ 2. Resize the window to be <500px What is the expected behavior? Red square changes to a smaller blue square when (max-width: 500px) media query applies. What went wrong? Square always displays as a smaller blue square. It works as if the media query is always true, even when the window is wider than 500px. Did this work before? Yes Stable 55.0.2883.87 is not affected Does this work in other browsers? Yes Chrome version: 57.0.2970.0 Channel: canary OS Version: 10.0 Flash Version: Shockwave Flash 24.0 r0 The media query works normally if directly included via <link rel="stylesheet">. The problem occurs when it is included via a HTML import (i.e. <link rel="import">, and the import document uses <link rel="stylesheet">).
,
Jan 3 2017
I'd be surprised if this was not caused by me.
,
Jan 4 2017
Able to reproduce the issue on the latest canary(57.0.2970.0) on Windows-10, Mac OS 10.12.2 and Linux Ubuntu 14.04. Regressed in M-57. Last good build: 57.0.2953.0 First bad build: 57.0.2954.0 Changelog: ========== https://chromium.googlesource.com/chromium/src/+log/206fee6c2a7ddb33c400a56adda7f53bf62157c2..90d4ea3d543f0031769b3aacac2d3e084b95fb7d Indeed rune's change: https://codereview.chromium.org/2557533005.
,
Jan 5 2017
,
Jan 5 2017
,
Jan 6 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/97c98f168ee37c3c114f85fb40cf893e75a4615b commit 97c98f168ee37c3c114f85fb40cf893e75a4615b Author: rune <rune@opera.com> Date: Fri Jan 06 07:55:23 2017 Use master StyleEngine to evaluate MQ in html imports. The StyleEngine for html import documents does not have a Frame which means size media queries will always evaluate to true. We incorrectly replaced a passed-in master document StyleEngine with the StyleEngine from the DocumentStyleSheetCollection in https://crrev.com/90d4ea3d That was wrong for evaluating media queries. R=meade@chromium.org BUG= 677963 Review-Url: https://codereview.chromium.org/2618803002 Cr-Commit-Position: refs/heads/master@{#441899} [add] https://crrev.com/97c98f168ee37c3c114f85fb40cf893e75a4615b/third_party/WebKit/LayoutTests/fast/css/media-query-in-html-import.html [modify] https://crrev.com/97c98f168ee37c3c114f85fb40cf893e75a4615b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp [modify] https://crrev.com/97c98f168ee37c3c114f85fb40cf893e75a4615b/third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.h [modify] https://crrev.com/97c98f168ee37c3c114f85fb40cf893e75a4615b/third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp [modify] https://crrev.com/97c98f168ee37c3c114f85fb40cf893e75a4615b/third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.h [modify] https://crrev.com/97c98f168ee37c3c114f85fb40cf893e75a4615b/third_party/WebKit/Source/core/dom/StyleEngine.cpp [modify] https://crrev.com/97c98f168ee37c3c114f85fb40cf893e75a4615b/third_party/WebKit/Source/core/dom/StyleEngine.h
,
Jan 6 2017
,
Jan 6 2017
Thanks for the quick fix! |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by shans@chromium.org
, Jan 3 2017Owner: meade@chromium.org
Status: Assigned (was: Unconfirmed)