Servo七月更新:平台扩展、Canvas加速、SVG网页字体支持等

Lobsters Hottest 工具

摘要

本文总结了2026年7月Servo网页引擎的更新,包括新的平台支持、性能提升、SVG中网页字体的添加,以及各种新的网页平台功能。

<p><a href="https://lobste.rs/s/8gved6/july_servo_more_platforms_faster_canvas">评论</a></p>
查看原文
查看缓存全文

缓存时间: 2026/09/01 11:42

# Servo 的七月动态:更多平台支持、更快的 Canvas、SVG 内的 Web 字体等! - Servo 致力于为开发者提供轻量级、高性能的替代方案,以便在应用程序中嵌入 Web 技术。来源:https://servo.org/blog/2026/08/31/july-in-servo/ **Servo 0.5.0** (https://github.com/servo/servo/releases/tag/v0.5.0) 包含了我们在七月落地的所有变更,共计 **488 次提交**,并且我们现在发布了 **Linux aarch64** 的二进制文件! (@mukilan (https://github.com/mukilan),#46760 (https://github.com/servo/servo/pull/46760)) **DOM 文本选择** 现在可见了 (@mrobinson (https://github.com/mrobinson),@SimonSapin (https://github.com/SimonSapin),#46698 (https://github.com/servo/servo/pull/46698),#46864 (https://github.com/servo/servo/pull/46864),#46742 (https://github.com/servo/servo/pull/46742),#46889 (https://github.com/servo/servo/pull/46889),#46126 (https://github.com/servo/servo/pull/46126))。交互式选择功能即将推出!有关安全修复,请参阅 **§ 安全** (https://servo.org/blog/2026/08/31/july-in-servo/#security) 部分。 servoshell 0.5.0 展示了多项新功能:'text-decoration-thickness'、'box-decoration-break'、内联 `` 中的 Web 字体,以及 DOM 选择渲染 (https://servo.org/img/blog/2026-08-diffie.png) 我们已经发布了多个新的 Web 平台功能: - **'Cache-Control: stale-while-revalidate'** (@arayaryoma (https://github.com/arayaryoma),#46060 (https://github.com/servo/servo/pull/46060)) - **'text-decoration-thickness'** (@nicoburns (https://github.com/nicoburns),#46592 (https://github.com/servo/servo/pull/46592)) - **'box-decoration-break'**,大部分支持 (@Psychpsyo (https://github.com/Psychpsyo),#45492 (https://github.com/servo/servo/pull/45492)) - **'@font-feature-values'**,大部分支持 (@simonwuelker (https://github.com/simonwuelker),#45308 (https://github.com/servo/servo/pull/45308)) - **'font-language-override'**,大部分支持 (@simonwuelker (https://github.com/simonwuelker),#46618 (https://github.com/servo/servo/pull/46618)) - **'font-variant-alternates'**,大部分支持 (@simonwuelker (https://github.com/simonwuelker),#45308 (https://github.com/servo/servo/pull/45308)) 此外还新增了一系列 DOM API: - **SubtleCrypto** 中的 **Ed448** (https://wicg.github.io/webcrypto-secure-curves/#ed448)、**X448** (https://wicg.github.io/webcrypto-secure-curves/#x448) 和 **KMAC** (https://wicg.github.io/webcrypto-modern-algos/#kmac) 算法 (@kkoyung (https://github.com/kkoyung),#46402 (https://github.com/servo/servo/pull/46402),#46141 (https://github.com/servo/servo/pull/46141),#46180 (https://github.com/servo/servo/pull/46180),#46583 (https://github.com/servo/servo/pull/46583),#46606 (https://github.com/servo/servo/pull/46606),#46622 (https://github.com/servo/servo/pull/46622),#46334 (https://github.com/servo/servo/pull/46334),#46376 (https://github.com/servo/servo/pull/46376)) - **document.execCommand()** 中的 **insertHorizontalRule**、**insertImage**、**insertText** 和 **forwardDelete** 命令 (@Psychpsyo (https://github.com/Psychpsyo),#46608 (https://github.com/servo/servo/pull/46608),#46597 (https://github.com/servo/servo/pull/46597),#46538 (https://github.com/servo/servo/pull/46538),#46838 (https://github.com/servo/servo/pull/46838)) - **AnimationEffect** (@simonwuelker (https://github.com/simonwuelker),#46677 (https://github.com/servo/servo/pull/46677)) - **新的 Touch()** (@yezhizhen (https://github.com/yezhizhen),#46741 (https://github.com/servo/servo/pull/46741)) - **Request** 上的 **duplex** 属性 (@Taym95 (https://github.com/Taym95),#46858 (https://github.com/servo/servo/pull/46858)) - **Animation** 上的 **effect** 属性 (@simonwuelker (https://github.com/simonwuelker),#46677 (https://github.com/servo/servo/pull/46677)) - **KeyframeEffect** 上的 **getKeyframes()** 和 **setKeyframes()** (@simonwuelker (https://github.com/simonwuelker),#46118 (https://github.com/servo/servo/pull/46118)) - **LargestContentfulPaint** 上的 **id** 属性 (@shubhamg13 (https://github.com/shubhamg13),#46828 (https://github.com/servo/servo/pull/46828)) - 只读的 **CSSFontFeatureValuesRule** (@simonwuelker (https://github.com/simonwuelker),#46728 (https://github.com/servo/servo/pull/46728)) 这又是一次大型更新,以下是概览: - **你可以提供帮助!** (https://servo.org/blog/2026/08/31/july-in-servo/#you-can-help) - **安全** (https://servo.org/blog/2026/08/31/july-in-servo/#security) - **现实世界兼容性** (https://servo.org/blog/2026/08/31/july-in-servo/#real-world-compat) - **进行中的工作** (https://servo.org/blog/2026/08/31/july-in-servo/#work-in-progress) - **嵌入式 API** (https://servo.org/blog/2026/08/31/july-in-servo/#embedding-api) - **面向用户和开发者** (https://servo.org/blog/2026/08/31/july-in-servo/#for-users-and-developers) - **Web 平台更多内容** (https://servo.org/blog/2026/08/31/july-in-servo/#more-on-the-web-platform) - **性能与稳定性** (https://servo.org/blog/2026/08/31/july-in-servo/#performance-and-stability) - **新贡献者** (https://servo.org/blog/2026/08/31/july-in-servo/#new-contributors) ## 你可以提供帮助! 如果你正在进行的拉取请求可能对月度更新有用,即使你不是百分之百确定,也可以通过以下步骤告诉我们: 1. 你将`monthly update`标签添加到你的拉取请求,或评论`@servo-highfive monthly update` 2. Highfive 会发布一条评论问你一些问题 3. 你在包含`@servo-highfive monthly update answer`的评论中回答这些问题 ## 安全 Servo 可能受到了 **quick-xml** (https://crates.io/crates/quick-xml) 和 **crossbeam-epoch** (https://crates.io/crates/crossbeam-epoch) 中漏洞的影响,这些已在 Servo 0.5.0 中修复 (@atouchet (https://github.com/atouchet),@Loirooriol (https://github.com/Loirooriol),#46737 (https://github.com/servo/servo/pull/46737),#46324 (https://github.com/servo/servo/pull/46324))。更多详情,请参阅 RUSTSEC-2026-0194 (https://rustsec.org/advisories/RUSTSEC-2026-0194)、RUSTSEC-2026-0195 (https://rustsec.org/advisories/RUSTSEC-2026-0195) 和 RUSTSEC-2026-0204 (https://rustsec.org/advisories/RUSTSEC-2026-0204)。 我们将 **ANGLE** (https://github.com/servo/mozangle) 从基于 Firefox 115.x ESR 的版本 (02755361e26d8 (https://hg.mozilla.org/mozilla-unified/file/02755361e26d82768eb1d5f576145e19d7c265cd/gfx/angle)) 更新到了基于 Firefox 140.12.0 ESR 的版本 (f8025617e815f (https://github.com/mozilla-firefox/firefox/commit/f8025617e815f21388b40baf189338d31a5f9a0a)),其中可能包含许多安全修复 (@jschwe (https://github.com/jschwe),@sagudev (https://github.com/sagudev),#46455 (https://github.com/servo/servo/pull/46455),mozangle#100 (https://github.com/servo/mozangle/pull/100))。 ## 现实世界兼容性 **DuckDuckGo** (duckduckgo.com (https://duckduckgo.com/)) 登陆页面上的鸭子现在可以在 v0.5.0 中渲染了,因为我们修复了一个影响 SVG 图像的预加载错误 (@jdm (https://github.com/jdm),#46668 (https://github.com/servo/servo/pull/46668))。 v0.4.0 v0.5.0 duckduckgo.com (https://duckduckgo.com/) 大多数 **Gumroad** (gumroad.com (https://gumroad.com/)) 页面(除了登陆页面)在 v0.4.0 中根本无法渲染,但从 v0.5.0 开始,诸如 **Discover 页面** (https://gumroad.com/discover) 或 **此产品页面** (https://harrycraft2.gumroad.com/l/theworldslongestcity) 这样的页面渲染得几乎完美。 v0.4.0 v0.5.0 gumroad.com (https://gumroad.com/discover) v0.4.0 v0.5.0 gumroad.com (https://harrycraft2.gumroad.com/l/theworldslongestcity) 我们很想知道你最喜欢的网站在 Servo 中运行得如何!成功的案例请在此 Zulip 话题中报告 (https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Servo.20web.20compat.20success.20stories/with/612898341),失败的案例请在我们的 GitHub issues 中报告 (https://github.com/servo/servo/issues)。 ## 进行中的工作 升级到 Stylo 2026-07-01 带来了内置 **CSS 函数** 的几项变更 (@Loirooriol (https://github.com/Loirooriol),#46129 (https://github.com/servo/servo/pull/46129)): - **'alpha()'** 现在支持,需启用偏好 `--pref layout_css_alpha_color_function_enabled` - **'progress()'** 现在支持,需启用偏好 `--pref layout_css_progress_function_enabled` - **'ellipse()'** 的值 **'closest-corner'** 和 **'farthest-corner'** 由于规范不确定性而不再稳定,但仍为实验性功能,需启用偏好 `--pref layout_css_ellipse_corners_enabled` - **'attr()'** 更加符合规范,需启用偏好 `--pref layout_css_attr_enabled` **WebGPU** 内容现在可以享受更好的一致性,并在 **GPUDevice** 上使用 **GPUExternalTexture** 和 **importExternalTexture()**,需启用偏好 `--pref dom_webgpu_enabled` (@sagudev (https://github.com/sagudev),#45873 (https://github.com/servo/servo/pull/45873),#46178 (https://github.com/servo/servo/pull/46178),#46286 (https://github.com/servo/servo/pull/46286))。 servoshell 0.5.0 展示了四个倾斜的矩形(在 WebGPU 中),使用外部视频帧(一只狗的图片)作为纹理 (https://servo.org/img/blog/2026-08-webgpu.png) **IndexedDB** 内容现在可以在 **IDBIndex** 上使用 **name** 属性,需启用偏好 `--pref dom_indexdb_enabled` (@skyz1 (https://github.com/skyz1),#45512 (https://github.com/servo/servo/pull/45512))。 **document.fonts** 现在包含一个 **FontFace** 对应每个有效的 **'@font-face'**,需启用偏好 `--pref dom_fontface_enabled` (@simonwuelker (https://github.com/simonwuelker),#46509 (https://github.com/servo/servo/pull/46509),#46537 (https://github.com/servo/servo/pull/46537))。 以上所有功能均已在 servoshell 的实验模式中启用 (https://book.servo.org/design-documentation/experimental-features.html#experimental-web-platform-features)。 我们已经开始实现 **WebVTT**,用于原生的 **字幕** 和 **解说**,默认启用(无需 `--pref`)。虽然它们尚未渲染,但我们现在可以获取每个字幕文件、解析 WebVTT 并通过 **HTMLTrackElement** 上的 **track** 属性公开提示信息 (@TimvdLippe (https://github.com/TimvdLippe),#46289 (https://github.com/servo/servo/pull/46289),#46383 (https://github.com/servo/servo/pull/46383))。 七月是 Servo **无障碍访问** 的一个重要月份,需启用偏好 `--pref accessibility_enabled`。本月的工作重点是 **性能**,无障碍树现在支持 **增量更新** (@alice (https://github.com/alice),@delan (https://github.com/delan),#45578 (https://github.com/servo/servo/pull/45578),#45971 (https://github.com/servo/servo/pull/45971),#46589 (https://github.com/servo/servo/pull/46589),#46691 (https://github.com/servo/servo/pull/46691),#46385 (https://github.com/servo/servo/pull/46385)),需要 **更少的 HashMap 查找** 和 **树遍历** (@alice (https://github.com/alice),@delan (https://github.com/delan),#45798 (https://github.com/servo/servo/pull/45798),#46740 (https://github.com/servo/servo/pull/46740),#46348 (https://github.com/servo/servo/pull/46348)),并允许 **更快的 DOM 修改** (@alice (https://github.com/alice),#46348 (https://github.com/servo/servo/pull/46348),#46530 (https://github.com/servo/servo/pull/46530))。 我们还开始了 **文件与目录条目 API** (https://wicg.github.io/entries-api/) 的实现工作,允许用户通过 `<input>` 和 **拖放** 来 **选择** 和 **上传整个目录**。为此,我们现在在 **DataTransferItem** 上有了 **webkitGetAsEntry()**,并对 **FileSystemEntry**、**FileSystemDirectoryEntry** 和 **FileSystemFileEntry** 提供了基本支持,需启用偏好 `--pref dom_entries_api_enabled` (@yezhizhen (https://github.com/yezhizhen),#46456 (https://github.com/servo/servo/pull/46456),#46879 (https://github.com/servo/servo/pull/46879),#46832 (https://github.com/servo/servo/pull/46832))。 ## 嵌入式 API 我们改进了 `servo` (https://doc.servo.org/servo/index.html) crate 和 **WebViewDelegate** (https://doc.servo.org/servo/trait.WebViewDelegate.html) 的文档 (@mukilan (https://github.com/mukilan),#46193 (https://github.com/servo/servo/pull/46193))。 **破坏性变更:** `ServoBuilder` (https://doc.servo.org/servo/struct.ServoBuilder.html)::`webxr_registry()` 已被 **移除**。请改为使用新的 `Servo` (https://doc.servo.org/servo/struct.Servo.html)::`register_webxr_registry` (https://doc.servo.org/servo/struct.Servo.html#method.register_webxr_registry),这是一个 **延迟** 设计,使得 servoshell 能够 **将启动时间减半** (@Narfinger (https://github.com/Narfinger),#46494 (https://github.com/servo/servo/pull/46494))。 ## 面向用户和开发者 **Android** 上的 **servoshell** 现在可在 **Android 10+**(91% 市场份额)上运行,而不仅仅是 Android 13+(68% 市场份额),提高了适应性并减少了浪费 (@jschwe (https://github.com/jschwe),#46142 (https://github.com/servo/servo/pull/46142),#46308 (https://github.com/servo/servo/pull/46308))。我们还修复了在 macOS 上为 Android 构建的问题 (@jschwe (https://github.com/jschwe),#46128 (https://github.com/servo/servo/pull/46128))。 **Windows** 上的 **servoshell** 现在在控制台窗口中运行时表现更好,使命令提示符等待 servoshell 退出 (@yezhizhen (https://github.com/yezhizhen),#43010 (https://github.com/servo/servo/pull/43010))。 当使用 Firefox **DevTools** 时,**Console** 标签页现在支持一些基本的 **自动补全** (@freyacodes (https://github.com/freyacodes),#46382 (https://github.com/servo/servo/pull/46382))。 我们已经完成了 Android 上 servoshell 的现代化,以使用 Compose UI (@veyndan (https://github.com/veyndan),#46085 (https://github.com/servo/servo/pull/46085),#46164 (https://github.com/servo/servo/pull/46164),#46253 (https://github.com/servo/servo/pull/46253),#46257 (https://github.com/servo/servo/pull/46257),#46317 (https://github.com/servo/servo/pull/46317),#46353 (https://github.com/servo/servo/pull/46353),#46565 (https://github.com/servo/servo/pull/46565),#46612 (https://github.com/servo/servo/pull/46612),#46626 (https://github.com/servo/servo/pull/46626),#46666 (https://github.com/servo/servo/pull/46666),#46663 (https://github.com/servo/servo/pull/46663),#46700 (https://github.com/servo/servo/pull/46700)),我们现在正在将作为库的 Servo 迁移到使用 Kotlin (@veyndan (https://github.com/veyndan),#46817 (https://github.com/servo/servo/pull/46817),#46895 (https://github.com/servo/servo/pull/46895),#46772 (https://github.com/servo/servo/pull/46772))。 ## Web 平台更多内容 **内联 SVG** 现在可以使用包含页面中定义的 **Web 字体** (@yodalee (https://github.com/yodalee),#45979 (https://github.com/servo/servo/pull/45979))。我们还在实现 **SVG DOM**,从 **SVGElement**、SVGCircleElement、SVGDefsElement、SVGEllipseElement、SVGLineElement、SVGLinearGradientElement、SVGPathElement、SVGPolygonElement、SVGPolylineElement、SVGRadialGradientElement、SVGStopElement、SVGRectElement、SVGSymbolElement 和 SVGUseElement 的存根接口开始 (@mu-mostafa98 (https://github.com/mu-mostafa98),#46558 (https://github.com/servo/servo/pull/46558))。 `<input type="file">` 现在可以 **垂直居中** 其内容 (@Loirooriol (https://github.com/Loirooriol),@mrobinson (https://github.com/mrobinson),#46590 (https://github.com/servo/servo/pull/46590)),并且表现更

相似文章

Servo 八月进展:CSS Grid、文本选择等

Lobsters Hottest

Servo 0.6.0 包含了八月的 417 个提交,默认启用 CSS Grid,并新增 touch-action、animation-composition 等 Web 平台特性以及众多 DOM API,同时改进了导航和会话历史功能。

探索新的 `servo` crate

Simon Willison's Blog

Servo 浏览器引擎现在作为一个可嵌入的 Rust crate (v0.1.0) 可用,使开发者能够将网页渲染能力集成到 Rust 应用中。一个新的 CLI 工具 `servo-shot` 展示了其使用基于软件渲染管线将网页渲染为 PNG 的能力。