Intent to Prototype: Constructable Stylesheet Objects
214 views
Skip to first unread message
Erik Nordin
unread,
Dec 6, 2019, 10:12:57 AM12/6/19
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to dev-pl...@lists.mozilla.org
Summary: <https://en.wikipedia.org/wiki/Elevator_pitch>Many web components
use the functionality of Shadow DOM
<https://w3c.github.io/webcomponents/spec/shadow/>. Currently, In order for
a stylesheet to take effect in a Shadow DOM, it must be specified using an
HTML <style> or <link> element within each shadow root
<https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot>.
Constructable Stylesheet Objects (CSO) provides an API to create reusable
stylesheet objects directly from script. This provides a convenient means
to create stylesheet references without being tied to a DOM node. CSOs can
then be adopted by, and shared by any number of shadow roots.
Secure Contexts: Enabled for both secure and insecure contexts.
Sandboxed iframes: This feature will be enabled by default in sandboxed
iframes.
Brian Grinstead
unread,
Dec 9, 2019, 11:54:33 AM12/9/19
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Erik Nordin, dev-pl...@lists.mozilla.org
I’m happy to hear this - we have an interest in using this feature in the browser chrome.
We usually load chrome://global/skin/global.css as a link in the Shadow DOM for our chrome Custom Elements and rely on sync stylesheet loading from the (chrome-only) prototype cache, but would like to stop relying on this as it has led to bugs like Bug 1590280 (see https://bugzilla.mozilla.org/show_bug.cgi?id=1590280#c27 for more details).
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
>
> DevTools Bug: TBD what, if anything, is needed.
>
In principle, if Constructable Stylesheets are included in the same APIs used to get and listen to regular stylesheets, DevTools should support them out-of-the box.
An overview of the continued API support to handle stylesheets in DevTools, as well as a way to track whether Constructable Stylesheets are supported by DevTools: https://bugzilla.mozilla.org/show_bug.cgi?id=1602535
The bug is explicitly about support in the Inspector, but the Style Editor uses the same APIs.