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.