This month in Servo: :is(), :where(), grid layout, parallel flexbox, and more!

2024-12-09 Plus shadow DOM buffs, smaller binaries, and new SubtleCrypto algorithms (HMAC, AES-GCM, AES-KW, PBKDF2).

Servo nightly showing new support for CSS grid layout, when enabled via `layout.grid.enabled`

Servo now supports :is() and :where() selectors (@mrobinson, #34066), parallel layout for flexbox (@mrobinson, #34132), and experimentally, CSS grid layout (@nicoburns, @taniishkaa, #32619, #34352, #34421)! To try our new grid layout support, run Servo with --pref layout.grid.enabled.

We’ve added support for two key Shadow DOM interfaces, the shadowRoot property on Element (@simonwuelker, #34306) and the innerHTML property on ShadowRoot (@simonwuelker, #34335).

We’ve also landed ‘justify-self’ on positioned elements (@chickenleaf, #34235), form submission with <input type=image> (@shanehandley, #34203), DataTransfer (@Gae24, #34205), the close() method on ImageBitmap (@simonwuelker, #34124), plus several new SubtleCrypto API features:

On OpenHarmony, we’ve landed keyboard input and the IME (@jschwe, @jdm, @mukilan, #34188), touch fling gestures (@jschwe, @mrobinson, #33219), and additional CJK fallback fonts (@jschwe, #34410). You can now build for OpenHarmony on a Windows machine (@jschwe, #34113), and build errors have been improved (@jschwe, #34267).

More engine changes

You can now scroll the viewport and scrollable elements with your pointer anywhere in the area, not just when hovering over actual content (@mrobinson, @mukilan, #34347). --unminify-js, a very useful feature for diagnosing Servo bugs in real websites, now supports module scripts (@jdm, #34206).

We’ve fixed the behaviour of offsetLeft and offsetTop relative to <body> with ‘position: static’ (@nicoburns, @Loirooriol, #32761), which also required spec changes (@nicoburns, @Loirooriol, w3c/csswg-drafts#10549). We’ve also fixed several layout bugs around:

The getClientRects() method on Element now correctly returns a DOMRectList (@chickenleaf, #34025).

Stylo has been updated to 2024-11-01 (@Loirooriol, #34322), and we’ve landed some changes to prepare our fork of Stylo for publishing releases on crates.io (@mrobinson, @nicoburns, #34332, #34353). We’ve also made more progress towards splitting up our massive script crate (@jdm, @sagudev, #34357, #34356, #34163), which will eventually allow Servo to be built (and rebuilt) much faster.

Performance improvements

In addition to parallel layout for flexbox (@mrobinson, #34132), we’ve landed several other performance improvements:

We’ve also landed some changes to reduce Servo’s binary size:

Servo’s tracing-based profiling support (--features tracing-perfetto or tracing-hitrace) now supports filtering events via an environment variable (@delan, #34236, #34256), and no longer includes events from non-Servo crates by default (@delan, #34209). Note that when the filter matches some span or event, it will also match all of its descendants for now, but this is a limitation we intend to fix.

Most of the events supported by the old interval profiler have been ported to tracing (@delan, #34238, #34337). ScriptParseHTML and ScriptParseXML events no longer count the time spent doing layout and script while parsing, reducing them to more realistic times (@delan, #34273), while ScriptEvaluate events now count the time spent running scripts in timers, DOM event listeners, and many other situations (@delan, #34286), increasing them to more realistic times.

We’ve added new tracing events for display list building (@atbrakhi, #34392), flex layout, inline layout, and font loading (@delan, #34392). This will help us diagnose performance issues around things like caching and relayout for ‘stretch’ in flex layout, shaping text runs, and font template creation.

For developers

Hacking on Servo is now easier, with our new --profile medium build mode in Cargo (@jschwe, #34035). medium is more optimised than debug, but unlike release, it supports debuggers, line numbers in backtraces, and incremental builds.

Servo now uses CODEOWNERS to list reviewers that are experts in parts of our main repo. This should make it much easier to find reviewers that know how to review your code, and helps us maximise the quality of our code reviews by allowing reviewers to specialise.

Donations

Thanks again for your generous support! We are now receiving 4291 USD/month (+2.1% over October) in recurring donations. We are no longer accepting donations on LFX — if you were donating there, please move your recurring donations to GitHub or Open Collective.

Servo is also on thanks.dev, and already fifteen GitHub users that depend on Servo are sponsoring us there. If you use Servo libraries like url, html5ever, selectors, or cssparser, signing up for thanks.dev could be a good way for you (or your employer) to give back to the community.

4291 USD/month
10000

With this money, we’ve been able to cover our web hosting and self-hosted CI runners for Windows and Linux builds. When the time comes, we’ll also be able to afford macOS runners and perf bots, as well as additional Outreachy interns next year! As always, use of these funds will be decided transparently in the Technical Steering Committee. For more details, head to our Sponsorship page.

Conferences and blogs