TakayoshiKochi / deprecate-style-in-html-imports

Deprecating/Removing <style> application from HTML Imports
https://takayoshikochi.github.io/deprecate-style-in-html-imports/
47 stars 44 forks source link

Possible to preview effect of change earlier than June 2018? #7

Closed donmccurdy closed 6 years ago

donmccurdy commented 6 years ago

Is there a flag or some other way for developers to preview the effect of this change, without waiting for it to roll out to everyone?

I'm using Polymer and have updated most of my dependencies but still see the error, and am not sure if that's just a stray div selector leaking to master document (which I wouldn't really care about) or whether some dependency is actually depending on this behavior.

Thanks!

TakayoshiKochi commented 6 years ago

Could you try passing --disable-blink-features=HTMLImportsStyleApplication option to chrome binary?

donmccurdy commented 6 years ago

In Chrome v64 and Chrome Canary I see:

You are using an unsupported command-line flag: --disable-blink-features=HTMLImportsStyleApplication. Stability and security will suffer.
TakayoshiKochi commented 6 years ago

You can ignore what the infobar (with yellow background on top of web contents) says. What the inforbar says is true, that it is not "supported" if you run Chrome with that flag, but it is for experimenting with some setting off, so please go ahead testing your site.

donmccurdy commented 6 years ago

Ok thanks! I still see the deprecation notice in the console, and no visible change to my site.. I guess that is good news / just some minor style leaked from my CSS?

TakayoshiKochi commented 6 years ago

The problem (for us, the implementors) is that even you move your <style> from your import file to the main document (e.g. via (document.body.appendChild(styleElement))), we still put the deprecation message upon parsing the <style> element in the import file, before running the script to move the element out of the import.

So, if you provide the option and you don't do any workaround, you'll see your style from the import won't get applied to the document and some styling / layout should break, while if you have some workaround there, you will see the expected rendering of the page, even though the deprecation warning is still there in the console.

donmccurdy commented 6 years ago

Makes sense, thanks :)