Intent to ship: CSS constructable stylesheets.

Skip to first unread message

Emilio Cobos Álvarez

May 23, 2022, 4:38:04 PM5/23/22
to Mozilla
A bit delayed, missed sending this email, but let me know if there's any
concern with this, still on time to disable for 101 if needed :)

In bug 1644102 (targeting Firefox 101) I enabled Constructable
Stylesheets on all channels. This is an API that allows authors to
programmatically share stylesheets across ShadowRoot instances, instead
of relying on engine optimizations for example.

This should improve memory usage (unclear if performance, in practice)
of large web component libraries (by avoiding having large DOM text
nodes duplicated for each component in inline styles).


Standards Body: W3C

Platform coverage: All

Preference: layout.css.constructable-stylesheets.enabled

DevTools bug: bug 1602535, bug 1769933

Other browsers:

The history of this feature is kind of turbulent. Chrome shipped way too
early, IMO, without accounting for various spec issues like

Thanks to the work of a lot of people we could reach to an agreement and
update the spec to address such concerns by using ObservableArray. I
believe this is now in good shape to ship, but let me know if there are
any concerns.

* Chromium: Shipped
* Safari: Not Yet Implemented

Thanks to Erik Nordin for all the initial work on the feature, to Edgar
Chen and Peter Van der Beken for implementing ObservableArray support
and their reviews, and to Nicolas Chevobbe for all the DevTools review.


-- Emilio
Reply all
Reply to author
0 new messages