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

Lobsters Hottest 工具

摘要

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

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

缓存时间: 2026/10/18 23:54

# Servo 八月动态:CSS Grid、文本选择等!— Servo 致力于为开发者提供一个轻量、高性能的替代方案,用于在应用中嵌入 Web 技术。 来源:https://servo.org/blog/2026/10/09/august-in-servo/ **Servo 0\.6\.0**(https://github.com/servo/servo/releases/tag/v0.6.0)包含了我们八月落地的所有变更,共计**417 个提交**!最大的消息是,我们已默认开启对 **CSS Grid** 的支持(@nicoburns(https://github.com/nicoburns),\#45621(https://github.com/servo/servo/pull/45621))。这对许多网站的视觉外观产生了巨大的积极影响!一只名叫 Gary 的黑白猫展示新的 Web 平台视觉特性(https://servo.org/img/blog/2026-10-gary.png)我们发布了多项新的 Web 平台特性: - **touch\-action**(@yezhizhen(https://github.com/yezhizhen),\#47043(https://github.com/servo/servo/pull/47043)) - **animation\-composition**(@nicoburns(https://github.com/nicoburns),\#47405(https://github.com/servo/servo/pull/47405)) - **color\-scheme**(@TimvdLippe(https://github.com/TimvdLippe),\#47042(https://github.com/servo/servo/pull/47042)) - **text\-transform** 的 **full\-width**、**math\-auto**、**full\-size\-kana** 取值(@SimonSapin(https://github.com/SimonSapin),\#47160(https://github.com/servo/servo/pull/47160),\#47160(https://github.com/servo/servo/pull/47160),\#47225(https://github.com/servo/servo/pull/47225)) 此外还有一批新的 DOM API: - **DedicatedWorkerGlobalScope** 上的 **requestAnimationFrame\(\)**(@Taym95(https://github.com/Taym95),\#46232(https://github.com/servo/servo/pull/46232)) - **Location** 上的 **ancestorOrigins**(@TimvdLippe(https://github.com/TimvdLippe),@mrobinson(https://github.com/mrobinson),\#46056(https://github.com/servo/servo/pull/46056)) - `` 上的 **imagesrcset** 和 **imagesizes**(@lumiscosity(https://github.com/lumiscosity),@TimvdLippe(https://github.com/TimvdLippe),\#47103(https://github.com/servo/servo/pull/47103)) - **CSSFontFaceRule** 上的 **style**(@simonwuelker(https://github.com/simonwuelker),\#47388(https://github.com/servo/servo/pull/47388)) - **Request** 上的 **isReloadNavigation** 和 **isHistoryNavigation**(@Taym95(https://github.com/Taym95),@yezhizhen(https://github.com/yezhizhen),\#46917(https://github.com/servo/servo/pull/46917)) - `` 上的 **name=color\-scheme**(@TimvdLippe(https://github.com/TimvdLippe),@jdm(https://github.com/jdm),\#46993(https://github.com/servo/servo/pull/46993)) - **focusin** 和 **focusout** 事件(@RichardTjokroutomo(https://github.com/RichardTjokroutomo),@yezhizhen(https://github.com/yezhizhen),\#46980(https://github.com/servo/servo/pull/46980)) - **new TextEvent\(\)**(@moamenhesham0(https://github.com/moamenhesham0),@mrobinson(https://github.com/mrobinson),\#47391(https://github.com/servo/servo/pull/47391)) - **BaseAudioContext** 上的 **PeriodicWave** 和 **createPeriodicWave**(@kevlu93(https://github.com/kevlu93),\#47492(https://github.com/servo/servo/pull/47492)) 本次发布还对**导航**、**文档加载**和**会话历史**做了重大改进,而这几部分正是 HTML 规范中最棘手(gnarliest)的部分(https://html.spec.whatwg.org/multipage/browsing-the-web.html#navigation-and-session-history)。谁能想到加载 `about:blank` 这么复杂呢(https://hsivonen.fi/about-blank/)?所有这些工作的成果是,打开额外窗口或包含 iframe 的页面现在运行得可靠多了。这又是一次大更新,以下是内容大纲: - **安全性**(https://servo.org/blog/2026/10/09/august-in-servo/#security) - **真实世界兼容性**(https://servo.org/blog/2026/10/09/august-in-servo/#real-world-compat) - **进行中的工作**(https://servo.org/blog/2026/10/09/august-in-servo/#work-in-progress) - **嵌入 API**(https://servo.org/blog/2026/10/09/august-in-servo/#embedding-api) - **面向用户和开发者**(https://servo.org/blog/2026/10/09/august-in-servo/#for-users-and-developers) - **Web 平台的更多进展**(https://servo.org/blog/2026/10/09/august-in-servo/#more-on-the-web-platform) - **性能与稳定性**(https://servo.org/blog/2026/10/09/august-in-servo/#performance-and-stability) - **新贡献者**(https://servo.org/blog/2026/10/09/august-in-servo/#new-contributors) ## 安全性 https://servo.org/blog/2026/10/09/august-in-servo/#security 我们升级到了 **SpiderMonkey v153**,这为 Servo 的 JavaScript 引擎集成带来了许多新的安全和崩溃修复(@sagudev(https://github.com/sagudev),@Gae24(https://github.com/Gae24),\#47489(https://github.com/servo/servo/pull/47489))。 从一个**已激活全屏模式**的文档导航离开时,现在会退出全屏模式(@shubhamg13(https://github.com/shubhamg13),@jdm(https://github.com/jdm),\#47123(https://github.com/servo/servo/pull/47123))。 ## 真实世界兼容性 https://servo.org/blog/2026/10/09/august-in-servo/#real-world-compat CSS Grid 默认启用意味着许多使用传统网格布局的网站现在显示正常,例如 rustweek\.org(https://rustweek.org/)。 v0\.5\.0 v0\.6\.0 2026\.rustweek\.org(https://2026.rustweek.org/)它还让许多你原本不会想到依赖 CSS Grid 的网站变得更好看了: v0\.5\.0 v0\.6\.0 labs\.jensimmons\.com(https://labs.jensimmons.com/)由触摸输入发起的平移手势现在会锁定到主导轴(@yezhizhen(https://github.com/yezhizhen),\#46983(https://github.com/servo/servo/pull/46983))。这使得在 Servo 中与页面交互时的平移行为更加可预测。 我们修复了一个影响 gumroad\.com\.au(https://gumroad.com.au/)的崩溃问题(@lumiscosity(https://github.com/lumiscosity),\#47266(https://github.com/servo/servo/pull/47266))。 我们很想知道你喜爱的网站在 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)。 ## 进行中的工作 https://servo.org/blog/2026/10/09/august-in-servo/#work-in-progress Servo 的**无障碍支持**持续取得长足进展;可通过 `--pref accessibility_enabled` 命令行参数启用。 Servo 现在会报告内容无障碍树中项目的**位置和尺寸**(@philocalyst(https://github.com/philocalyst),@alice(https://github.com/alice),@mrobinson(https://github.com/mrobinson),\#46996(https://github.com/servo/servo/pull/46996)),使 macOS VoiceOver 能够更可靠地工作。 我们还向无障碍工具包报告了许多 Web 内容元素的 **ARIA 角色**(https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles)(@mukilan(https://github.com/mukilan),\#47318(https://github.com/servo/servo/pull/47318))。 支持的角色完整列表 - alert - banner - blockquote - caption - code - complementary - contentinfo - definition - deletion - directory - document - emphasis - feed - figure - generic - insertion - list - log - main - math - navigation - none - note - paragraph - presentation - rowgroup - search - status - strong - term - time - timer Servo 对 **Document\.execCommand\(\)** 的支持正在快速改进,可通过 `--pref dom_exec_command_enabled` 启用。 我们修复了 **inserttext** 命令的问题(@Psychpsyo(https://github.com/Psychpsyo),\#47224(https://github.com/servo/servo/pull/47224),\#47306(https://github.com/servo/servo/pull/47306))、编辑不可编辑内容的问题(@Psychpsyo(https://github.com/Psychpsyo),\#47362(https://github.com/servo/servo/pull/47362))、包含节点的计算问题(@TimvdLippe(https://github.com/TimvdLippe),\#47429(https://github.com/servo/servo/pull/47429))、在 **contenteditable** 中调整选区的问题(@mrobinson(https://github.com/mrobinson),\#47393(https://github.com/servo/servo/pull/47393),\#47581(https://github.com/servo/servo/pull/47581),\#47581(https://github.com/servo/servo/pull/47581)),并实现了 **indent** 和 **insertLineBreak** 命令(@Psychpsyo(https://github.com/Psychpsyo),\#47416(https://github.com/servo/servo/pull/47416),\#47445(https://github.com/servo/servo/pull/47445))。 我们在 **LargestContentfulPaint** 性能指标上取得了大量进展,该功能通过 `--pref largest_contentful_paint_enabled` 参数在幕后实现。Servo 现在支持 **element** 和 **loadTime** 属性(@shubhamg13(https://github.com/shubhamg13),\#46553(https://github.com/servo/servo/pull/46553),\#47475(https://github.com/servo/servo/pull/47475))、视频元素 poster 的 URL(@shubhamg13(https://github.com/shubhamg13),\#43376(https://github.com/servo/servo/pull/43376))、准确的尺寸信息(@shubhamg13(https://github.com/shubhamg13),\#43378(https://github.com/servo/servo/pull/43378)),以及文本节点的绘制(@shubhamg13(https://github.com/shubhamg13),\#47212(https://github.com/servo/servo/pull/47212))。 为未来的 **AudioWorklet**(https://developer.mozilla.org/en-US/docs/Web/API/AudioWorklet)实现做了准备工作(@niyabits(https://github.com/niyabits),\#46856(https://github.com/servo/servo/pull/46856),\#47016(https://github.com/servo/servo/pull/47016),\#47199(https://github.com/servo/servo/pull/47199))。更多详情请参阅 Niya 关于她 Outreachy 项目的博客文章(https://text.tchncs.de/niya/wrapping-up-my-work-on-servos-audioworklet)! 我们继续推进 **ServiceWorker** 功能,可通过 `--pref dom_serviceworker_enabled` 启用。本月我们实现了 **CookieStore** 接口,通过 `--pref dom_cookiestore_enabled` 命令行参数启用(@Taym95(https://github.com/Taym95),\#47044(https://github.com/servo/servo/pull/47044)),以及 **Cache** 接口(@gterzian(https://github.com/gterzian),\#47220(https://github.com/servo/servo/pull/47220))。 Servo 现在支持**基于磁盘的 HTTP 缓存**,可通过 `--pref network_http_disk_cache` 启用(@Narfinger(https://github.com/Narfinger),\#43819(https://github.com/servo/servo/pull/43819))。该缓存会在多次运行之间持久保存,但目前还没有清除它的方法。 ## 嵌入 API https://servo.org/blog/2026/10/09/august-in-servo/#embedding-api **破坏性变更:** `WebView`(https://doc.servo.org/servo/struct.WebView.html)的 `toggle_sampling_profiler` 已被移除(@lumiscosity(https://github.com/lumiscosity),\#47014(https://github.com/servo/servo/pull/47014))。 如需在 Servo 上进行采样性能分析,请按照手册(https://book.servo.org/contributing/profiling.html)中的说明操作。 **破坏性变更:** `MouseButton`(https://doc.servo.org/servo/enum.MouseButton.html)的变体已重命名为 `Primary`、`Secondary` 和 `Auxiliary`(@mrobinson(https://github.com/mrobinson),@SimonSapin(https://github.com/SimonSapin),\#47327(https://github.com/servo/servo/pull/47327))。 我们新增了几个反映常见使用模式的 Cargo feature: - `default_web_features`,在构建中包含可选的 Web 平台特性(例如 WebXR 和 WebGPU)(@jschwe(https://github.com/jschwe),\#44032(https://github.com/servo/servo/pull/44032)) - `bundled`,将必需的资源包含在二进制文件中(@jschwe(https://github.com/jschwe),\#44032(https://github.com/servo/servo/pull/44032)) - `brotli-compression-stream`,启用 `CompressionStream`/`DecompressionStream` Web API 对 `brotli` 内容的支持(@Narfinger(https://github.com/Narfinger),@jdm(https://github.com/jdm),\#47197(https://github.com/servo/servo/pull/47197)) - `webcrypto`,启用 Crypto 和 WebCrypto Web API 的支持(@Narfinger(https://github.com/Narfinger),\#47198(https://github.com/servo/servo/pull/47198)) - `webgl`,启用 WebGL 支持(@janeoa(https://github.com/janeoa),\#47200(https://github.com/servo/servo/pull/47200)) ## 面向用户和开发者 https://servo.org/blog/2026/10/09/august-in-servo/#for-users-and-developers 一个显而易见的变化是,交互式**文本选择**现在可以用了!这是我们在脚本和布局代码中大量工作的成果,确保选区尊重页面内容的实际几何位置(@mrobinson(https://github.com/mrobinson),@SimonSapin(https://github.com/SimonSapin),\#47022(https://github.com/servo/servo/pull/47022),\#47025(https://github.com/servo/servo/pull/47025),\#47329(https://github.com/servo/servo/pull/47329),\#47358(https://github.com/servo/servo/pull/47358),\#46982(https://github.com/servo/servo/pull/46982),\#47425(https://github.com/servo/servo/pull/47425),\#47438(https://github.com/servo/servo/pull/47438),\#47437(https://github.com/servo/servo/pull/47437),\#47581(https://github.com/servo/servo/pull/47581),\#47070(https://github.com/servo/servo/pull/47070),\#47048(https://github.com/servo/servo/pull/47048),\#46963(https://github.com/servo/servo/pull/46963))。 servoshell 0\.6\.0 在使用 CSS perspective 的元素上进行文本选择(https://servo.org/img/blog/2026-10-select.png)现在在所有平台上构建 Servo 至少需要 **Clang 19**(@jschwe(https://github.com/jschwe),\#47421(https://github.com/servo/servo/pull/47421))。此外,为 OpenHarmony 构建现在需要 `cargo-ohos` 工具(@jschwe(https://github.com/jschwe),\#47334(https://github.com/servo/servo/pull/47334))。 Windows 上的调试构建现在可以成功完成(@jschwe(https://github.com/jschwe),\#47372(https://github.com/servo/servo/pull/47372))。 Linux arm64 构建已针对 **Raspberry Pi 5** 进行了适配(@mukilan(https://github.com/mukilan),\#47113(https://github.com/servo/servo/pull/47113))。任何面向同一平台的 libservo 嵌入方如果使用 jemalloc,也需要进行类似的更改。 ### servoshell https://servo.org/blog/2026/10/09/august-in-servo/#servoshell 在 **Wayland** 和 **OpenHarmony** 下,我们现在与系统剪贴板集成(@TheZoq2(https://github.com/TheZoq2),@yezhizhen(https://github.com/yezhizhen),@jschwe(https://github.com/jschwe),\#46938(https://github.com/servo/servo/pull/46938),\#47177(https://github.com/servo/servo/pull/47177))。 macOS 的 Command 键和 Windows 的徽标键现在报告为 `Meta` 而不再是 `Super`(@eachra-bawn(https://github.com/eachra-bawn),\#47330(https://github.com/servo/servo/pull/47330))。 **Android** 移植在为其 **Compose UI** 进行现代化改造(@veyndan(https://github.com/veyndan),\#47656(https://github.com/servo/servo/pull/47656),\#47491(https://github.com/servo/servo/pull/47491),\#47494(https://github.com/servo/servo/pull/47494),\#47697(https://github.com/servo/servo/pull/47697),\#46955(https://github.com/servo/servo/pull/46955),\#47644(https://github.com/servo/servo/pull/47644),\#47652(https://github.com/servo/servo/pull/47652),\#47276(https://github.com/servo/servo/pull/47276),\#47277(https://github.com/servo/servo/pull/47277),\#47299(https://github.com/servo/servo/pull/47299),\#47439(https://github.com/servo/servo/pull/47439))以及将其实现转换为 Kotlin(@veyndan(https://github.com/veyndan),\#46926(https://github.com/servo/servo/pull/46926),\#46925(https://github.com/servo/servo/pull/46925),\#46951(https://github.com/servo/servo/pull/46951),\#46965(https://github.com/servo/servo/pull/46965))的过程中,磨平了许多粗糙之处。 库的使用者不再需要自行实现**暂停和恢复**支持(@veyndan(https://github.com/veyndan),\#47555(https://github.com/servo/servo/pull/47555))。 与此同时,**OpenHarmony** 移植现在支持使用 US 键盘布局的外接键盘(@jschwe(https://github.com/jschwe),\#47359(https://github.com/servo/servo/pull/47359))。 此外,CJK 字符的后备字体选择也更加完善了(@RichardTjokroutomo(https://github.com/RichardTjokroutomo),\#47116(https://github.com/servo/servo/pull/

相似文章

探索新的 `servo` crate

Simon Willison's Blog

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