https://github.com/WICG/construct-stylesheets/issues/133 - no explainer as this is a small improvement, and spec change is pending due to the dependency on moving to the DOM & CSSOM specs (but should be simple).
When adopting a shadow root into a <template> document from a document that the <template> is in (or vice versa), we will no longer clear its adoptedStyleSheets.
Currently we always clear adoptedStyleSheets when the shadow root containing it is adopted into a different document. The main reason for this is to ensure constructed stylesheets are not used across <iframe>s, but this also covers adopting into/from <template>s, causing some confusion to web developers (see https://crbug.com/1111864)
We recently assessed that there should be no problem with keeping adoptedStyleSheets on adoption for the <template> case, as the lifetime of a <template> is bounded by the lifetime of the document containing it. For more details, see https://github.com/WICG/construct-stylesheets/issues/133.
Interoperability and Compatibility
The risk for this change should be low as the behavior change is small (and more intuitive) and Chrome is the only browser that has shipped adoptedStyleSheets (Firefox implementation is pending).
Edge: No signals
Firefox: No signals
Safari: No signals
Web / Framework developers: Positive (see bug)
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Is this feature fully tested by web-platform-tests?
Yes (tests added in https://chromium-review.googlesource.com/c/chromium/src/+/2464519)
Link to entry on the feature dashboard
Requesting approval to ship?Yes
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACPC1r6bgbBHpXNseRmTqSzOEPf0A_ZZW%2BHwS2sXqzbK28A0ng%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw8CiMwnU0fTFsJnKmjWaFwOS5hjUq3T59LwC%2BRqsc6X6Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGH7WqELvBAzaiCR453rDfp3fmUSjehWtQmZ-wGytJ%3DietZ3zA%40mail.gmail.com.