A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

[proposal] Constructable StyleSheet Objects

TakayoshiKochi
2018-02-05

Explainer / Spec draft

We would like to propose contructable stylesheet objects, which enables you to construct a CSSStyleSheet object from a constructor.

The motivation behind this is for web pages that contains lots of web components, potentially all the same component, each component has to have a stylesheet (via <style> or <link rel=stylesheet>), which is quite redundant and prevents rendering engines from optimizing memory and speed of component construction.

This gives an opportunity to pass a constructed CSSStyleSheet to shadow root, without overhead of parsing the same stylesheet again.

For more details, please take a look at the explainer.

marcosc
2018-02-06

This seems pretty neat. Has this been shared with folks at Moz yet?

TakayoshiKochi
2018-02-06

Chromium bug is here: https://bugs.chromium.org/p/chromium/issues/detail?id=807560 and an intent to implement is sent to blink-dev list: https://groups.google.com/a/chromium.org/d/topic/blink-dev/irhrlr6n5YQ/discussion

We got detailed feedback from Boris on the blink-dev list, so at least Boris and you at Moz already know this :slight_smile: Could you help for sharing more?

As Boris already pointed out there, the spec needs more polish. We would like to make it available with an experimental implementation to get some numbers and get initial feedback from everyone.

Feel free to file an issue at

or leave a comment here.

marcosc
2018-02-06

Ok, cool. As long as Boris has seen it, then that’s great. When you are generally happy with the spec (and polished it up a bit as Boris suggested), I can ask for a review and “position” from Mozilla folks at http://github.com/mozilla/standards-positions/.

Let me know by pinging me here or on github!