September in Servo: progress, rounded rectangles, and more

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

September in Servo: , rounded rectangles, and more! Plus new CSS functions and WEbGL2 improvements. Posted 2026-11-05 Servo 0.7.0 contains all of the changes we landed in September, spanning 527 commits! The developer tools console now eagerly evaluates JS inputs, allowing faster feedback (@freyacodes, #47527).

Servo 九月动态: 元素、圆角矩形及更多更新!此外还有新的 CSS 函数和 WebGL2 改进。发布于 2026 年 11 月 5 日。Servo 0.7.0 包含了我们在九月合并的所有更改,共计 527 次提交!开发者工具控制台现在可以主动评估 JS 输入,从而实现更快的反馈(@freyacodes, #47527)。

We’ve shipped new web platform features: the :checked pseudoclass (@skyz1, #47987) the user-select property (@SimonSapin, @mrobinson, #48137, #48242) the element (@rayguo17, #46974) CSS typed arithmetic (@Loirooriol, #48338) the alpha() CSS function (@Loirooriol, #48344) the font-width property (@Loirooriol, #47914) Plus a bunch of new DOM APIs: parentRule on CSSRule and CSSStyleDeclaration (@skyz1, #47743) version on HTMLHtmlElement (@SilvioPilato, #47786) getComposedRanges() and direction on Selection (@mrobinson, #47683) baseURL on CSSStyleSheet (@Gae24, #47783) CSS modules(@Gae24, #47813) and text modules (@Gae24, #47863) getContextAttributes() on CanvasRenderingContext2D and OffscreenCanvasRenderingContext2D (@Taym95, #47868) the Content-Language header (@TimvdLippe, #47930) dir on Document (@yezhizhen, #48170) SVGAElement, SVGPatternElement, SVGTSpanElement, SVGTextContentElement, SVGTextElement, SVGTextPositioningElement (@mu-mostafa98, #48174) the MLKEM768-X25519 algorithm for WebCrypto (@kkoyung, #48240, #48282, #48313, #48350) roundRect() on CanvasRenderingContext2D (@yezhizhen, #48293) paintTime and presentationTime on PerformancePaintTiming (@shubhamg13, #47926) getCueAsHTML() on VTTCue (@TimvdLippe, #48146)

我们发布了多项新的 Web 平台特性::checked 伪类(@skyz1, #47987)、user-select 属性(@SimonSapin, @mrobinson, #48137, #48242)、 元素(@rayguo17, #46974)、CSS 类型化算术(@Loirooriol, #48338)、alpha() CSS 函数(@Loirooriol, #48344)以及 font-width 属性(@Loirooriol, #47914)。此外还有一系列新的 DOM API:CSSRule 和 CSSStyleDeclaration 上的 parentRule(@skyz1, #47743)、HTMLHtmlElement 上的 version(@SilvioPilato, #47786)、Selection 上的 getComposedRanges() 和 direction(@mrobinson, #47683)、CSSStyleSheet 上的 baseURL(@Gae24, #47783)、CSS 模块(@Gae24, #47813)和文本模块(@Gae24, #47863)、CanvasRenderingContext2D 和 OffscreenCanvasRenderingContext2D 上的 getContextAttributes()(@Taym95, #47868)、Content-Language 标头(@TimvdLippe, #47930)、Document 上的 dir(@yezhizhen, #48170)、SVGAElement 等 SVG 相关元素(@mu-mostafa98, #48174)、WebCrypto 的 MLKEM768-X25519 算法(@kkoyung, #48240, #48282, #48313, #48350)、CanvasRenderingContext2D 上的 roundRect()(@yezhizhen, #48293)、PerformancePaintTiming 上的 paintTime 和 presentationTime(@shubhamg13, #47926)以及 VTTCue 上的 getCueAsHTML()(@TimvdLippe, #48146)。

Security We upgraded to SpiderMonkey v153.3 and mozangle v0.7, both of which included fixes for security bugs reported upstream (@sagudev, #48176, #47655, #48259). Real world compat The egui.rs demo now works as expected with —pref dom._webegpu_enabled. This Candy Crush game is now playable. We’re interested to hear how well your favourite websites run in Servo! Report successes in this Zulip thread or this Github discussion, and failures in our GitHub issues.

安全性方面,我们升级到了 SpiderMonkey v153.3 和 mozangle v0.7,两者均包含了针对上游报告的安全漏洞的修复(@sagudev, #48176, #47655, #48259)。在真实世界兼容性方面,egui.rs 演示现在可以在启用 —pref dom._webegpu_enabled 的情况下正常工作,Candy Crush 游戏现在也可以游玩了。我们很想了解您最喜爱的网站在 Servo 中的运行情况!请在 Zulip 线程或 GitHub 讨论区报告成功案例,并将失败案例提交至我们的 GitHub Issues。

Work in progress Our accessibility tree (—pref accessibility_enabled) now reports geometry bounds for inline elements (@alice, #47905) and does much less work when responding to DOM changes (@alice, @mrobinson, #47690). Additionally, elements with display: none are reported as hidden (@alice, #47772). We had lots of conformance improvements for our WebGL2 implementation (—pref dom_webgl2_enabled) (@mxmgorin, #48423, #48441, #48470, #48479, #48495, #48473, #48536). Support for WSIWYG editors (which rely heavily on contenteditable) is going very well: keyboard inputs are now hooked up when —pref dom_exec_command_enabled is present, so many editors are now usable (example).

开发进度方面,我们的辅助功能树(—pref accessibility_enabled)现在可以报告内联元素的几何边界(@alice, #47905),并在响应 DOM 更改时减少了大量工作(@alice, @mrobinson, #47690)。此外,display: none 的元素现在会被报告为隐藏(@alice, #47772)。我们在 WebGL2 实现(—pref dom_webgl2_enabled)方面进行了大量的一致性改进(@mxmgorin, #48423, #48441, #48470, #48479, #48495, #48473, #48536)。对 WYSIWYG 编辑器(严重依赖 contenteditable)的支持进展顺利:当启用 —pref dom_exec_command_enabled 时,键盘输入现已连接,因此许多编辑器现在已可使用(示例)。

Closed captioning for video elements is making progress. Text tracks now fire enter, exit, and cuechange events (@TimvdLippe, #47725). Media elements now return the full sorted list of text tracks (@TimvdLippe, #47785), and adding cues to a text track now sets that track correctly (@TimvdLippe, #48012). Text track objects now reflect the attributes of the associated element. Text track URLs are fetched at the correct time (@TimvdLippe, #48325), and active cues are computed correctly (@TimvdLippe, #48305), while text track cues are ordered as expected (@TimvdLippe, #48368). Additionally, WebVTT parsing can now recover from errors (@TimvdLippe, #48391).

视频元素的隐藏式字幕功能正在取得进展。文本轨道现在会触发 enter、exit 和 cuechange 事件(@TimvdLippe, #47725)。媒体元素现在返回完整的已排序文本轨道列表(@TimvdLippe, #47785),向文本轨道添加提示现在可以正确设置该轨道(@TimvdLippe, #48012)。文本轨道对象现在反映了关联 元素的属性。文本轨道 URL 在正确的时间被获取(@TimvdLippe, #48325),活动提示被正确计算(@TimvdLippe, #48305),同时文本轨道提示按预期排序(@TimvdLippe, #48368)。此外,WebVTT 解析现在可以从错误中恢复(@TimvdLippe, #48391)。

The Sanitizer API (—pref dom_sanitizer_enabled) now accepts the javascriptURLs property (@skyz1, #47867). IndexedDB continues to improve: tables no longer error if unrelated tables contain duplicate index names (—pref dom_indexeddb_enabled) (@leowatts, #47936). Additionally, we implemented openCursor() and openKeyCursor() on IDBIndex (@kuntal-devrat, #48281), as well as advance(), continue(), and continuePrimaryKey() on IDBCursor (@kuntal-devrat, #48400). We implemented the getTimeline() and setTimeline() methods for the Animation interface (—pref dom_web_animations_enabled) (@simonwuelker, #48122).

Sanitizer API(—pref dom_sanitizer_enabled)现在接受 javascriptURLs 属性(@skyz1, #47867)。IndexedDB 持续改进:如果无关表包含重复的索引名称,表不再报错(—pref dom_indexeddb_enabled)(@leowatts, #47936)。此外,我们在 IDBIndex 上实现了 openCursor() 和 openKeyCursor()(@kuntal-devrat, #48281),并在 IDBCursor 上实现了 advance()、continue() 和 continuePrimaryKey()(@kuntal-devrat, #48400)。我们为 Animation 接口实现了 getTimeline() 和 setTimeline() 方法(—pref dom_web_animations_enabled)(@simonwuelker, #48122)。

Embedding API There’s a new API for events originating from accessibility tools: Servo::forward_accessibility_action (@alice, @mrobinson, #48512). There is also an API to clear session history: WebView::clear_session_history (@Narfinger, #47483). The WebView::set_throttled API has been removed (@mrobinson, #39923). Throttling automatically occurs when a WebView is hidden and is stopped when shown. The WebViewDelegate::notify_focus_changed method was removed, along with the Servo methods focus and blur (@mrobinson, #48364). Embedders must call WebView::set_focused whenever a WebView has gained or lost system focus.

嵌入 API 方面,有一个用于处理来自辅助工具事件的新 API:Servo::forward_accessibility_action(@alice, @mrobinson, #48512)。还有一个用于清除会话历史记录的 API:WebView::clear_session_history(@Narfinger, #47483)。WebView::set_throttled API 已被移除(@mrobinson, #39923)。当 WebView 隐藏时会自动进行节流,显示时则停止。WebViewDelegate::notify_focus_changed 方法已被移除,Servo 的 focus 和 blur 方法也一并移除(@mrobinson, #48364)。嵌入者必须在 WebView 获得或失去系统焦点时调用 WebView::set_focused。

The webgl feature has been added to the default_web_features feature (@janeoa, #47866). If an embedding does not want to ship with WebGL support they will now need to disable default features. Multiprocess mode is enabled at build time with the new Cargo feature multprocess (@Narfinger, #47360). To remove support for this feature (reducing binary size by ~2MB), build Servo with default features disabled. Two new preferences exist to tune garbage collector behaviour: js_mem_gc_malloc_threshold_base_mb and js_mem_gc_urgent_threshold_mb (@mxmgorin, #47999). These can help on memory-constrained devices, and more information is available in the SpiderMonkey source (base, urgent). The JVM compatibility target was raised to 11 on Android (@veyndan, #48414).

webgl 特性已被添加到 default_web_features 特性中(@janeoa, #47866)。如果嵌入应用不想附带 WebGL 支持,现在需要禁用默认特性。多进程模式在构建时通过新的 Cargo 特性 multprocess 启用(@Narfinger, #47360)。要移除此特性支持(可减少约 2MB 的二进制文件大小),请在禁用默认特性的情况下构建 Servo。有两个新的首选项用于调整垃圾回收行为:js_mem_gc_malloc_threshold_base_mb 和 js_mem_gc_urgent_threshold_mb(@mxmgorin, #47999)。这些设置有助于在内存受限的设备上运行,更多信息可在 SpiderMonkey 源码中找到(base, urgent)。Android 上的 JVM 兼容性目标已提升至 11(@veyndan, #48414)。

For users and developers It is now possible to cross-compile the OpenHarmony build from Windows hosts (@jschwe, #48392). Unhandled promise rejections are reported to the JS console (@TTyChud, #48486), making it easier to narrow down web compatibility issues in Servo. The OpenHarmony SDK was updated to API level 23 (@Narfinger, #48505). Pressing Control+A (or Command+A on macOS) now selects all the content in a document (@dzfrias, @mrobinson, #48025). It is no longer possible to copy text inside of password inputs (@dzfrias, #48404). Embedder-originating JS (e.g. devtools console or embedding APIs) will always

对于用户和开发者,现在可以从 Windows 主机交叉编译 OpenHarmony 构建版本(@jschwe, #48392)。未处理的 Promise 拒绝会被报告到 JS 控制台(@TTyChud, #48486),这使得在 Servo 中缩小 Web 兼容性问题的范围变得更加容易。OpenHarmony SDK 已更新至 API 23 级别(@Narfinger, #48505)。按下 Control+A(或 macOS 上的 Command+A)现在可以选择文档中的所有内容(@dzfrias, @mrobinson, #48025)。现在无法再复制密码输入框内的文本(@dzfrias, #48404)。源自嵌入者的 JS(例如开发者工具控制台或嵌入 API)将始终