When dynamically changing a <style> element’s media attribute from "none" to "all", the CSS is still ignored
Reported by
sime.vi...@gmail.com,
Aug 18 2017
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0 Steps to reproduce the problem: 1. Click the 'Switch' button What is the expected behavior? The text on the page should become red. What went wrong? Chrome still ignores the <style> element, and its CSS styles. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 62.0.3189.0 (Official Build) canary (64-bit) (cohort: Clang-64) Channel: canary OS Version: 10.0 Flash Version: Clicking the 'Trim' button will make it work in Chrome. (It’s a hack.) Note that in Firefox, Safari, and Edge, the CSS does become active once the <style media> attribute is set to an active media type, so this is a Chrome-only problem.
,
Aug 19 2017
Not a regression. WebKit fixed it at some point between Safari 9.1 and Safari 10.1, but I cannot find the exact change set. :( It would be good to add a reference test in web-platform-test (if one does not exist already) for this case. I took a shot at it (work in progress) - https://github.com/phistuck/web-platform-tests/blob/style-media-change/css/mediaqueries-3/style-media-change.html
,
Aug 21 2017
,
Aug 21 2017
,
Aug 21 2017
This is related to issue 757450 .
,
Aug 21 2017
Another related issue is 757452.
,
Aug 24 2017
,
Aug 24 2017
#7 - You may continue the work I started for adding a test to web-platform-tests for it (no credit needed) - https://github.com/phistuck/web-platform-tests/commit/b917c9692382d477b6962f43a7e98f01f0421e6c
,
Aug 28 2017
Issue 759420 has been merged into this issue.
,
Aug 29 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cbe78d23e79476b05503d6fe028b83addfc45d6e commit cbe78d23e79476b05503d6fe028b83addfc45d6e Author: Shanmuga Pandi M <shanmuga.m@samsung.com> Date: Tue Aug 29 12:48:36 2017 Changing <style> element's media attribute should reflect is CSS. CSSStyleSheet is not created for style elements when the media type is not matching screen or print earlier. With this change, it will create style sheet for all media types. Bug: 756804 , 759420 , 757450 Change-Id: I8c38f2daf6d70b749a0f8de394d646f755695d02 Reviewed-on: https://chromium-review.googlesource.com/631859 Reviewed-by: Rune Lillesveen <rune@opera.com> Commit-Queue: Shanmuga Pandi <shanmuga.m@samsung.com> Cr-Commit-Position: refs/heads/master@{#498083} [add] https://crrev.com/cbe78d23e79476b05503d6fe028b83addfc45d6e/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-style-element/style_media_change.html [add] https://crrev.com/cbe78d23e79476b05503d6fe028b83addfc45d6e/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-style-element/style_non_matching_media.html [modify] https://crrev.com/cbe78d23e79476b05503d6fe028b83addfc45d6e/third_party/WebKit/Source/core/dom/StyleElement.cpp
,
Aug 30 2017
|
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by ligim...@chromium.org
, Aug 18 2017Labels: -Pri-2 Needs-Triage-M60 Needs-Bisect Pri-1