CSS Typed OM has been enabled in Firefox Nightly since Firefox 154. Since then we’ve been working on the remaining gaps, to get to parity with the implementations in other browsers. With the pref enabled, Firefox now passes about 94% of the Typed OM subtests in WPT.
Last week I sent the
intent to ship.
If all goes well, Typed OM will ride the trains and it will be enabled by
default in Firefox 161. Chrome and Safari already ship it, so Firefox is
catching up here. The color part of the API (CSSColorValue and friends) is
not included yet, it stays behind a separate pref for now.
I’ve been
working on Typed OM at
Igalia for quite some time. At the beginning I
thought it’s mostly about adding new JavaScript APIs, but it involved quite a
few parts of Gecko. The DOM bindings were the obvious part. Then there is the
style system, which is written in Rust, and all the code which converts CSS
values to typed objects and back. For example a simple call like
el.attributeStyleMap.get("width") goes through more layers than I expected.
This work has been part of a Sovereign Tech Fund investment. Thanks to the Sovereign Tech Fund for the support. There are more details on the Igalia website.
Most of my patches were reviewed by Emilio Cobos Álvarez and David Shin from Mozilla. Big thanks to both of them. Their reviews were quick and to the point, and I learned a lot from them.
In June I gave a presentation about this work to my team at Igalia. When I was preparing it, I found out there are quite a lot of details and decisions which deserve a closer look. So I’d like to write a few posts based on that presentation. Probably something about the design decisions and about working across Rust and C++, then testing and interop, and maybe also a few things which surprised me.
For now I’m just happy that Typed OM is finally close to shipping.