展示HN:Aurora – 一个用Rust编写的浏览器引擎实验

1作者: JohannaAlmeida3 个月前原帖
我正在构建Aurora,这是一个早期阶段的Rust浏览器引擎。 目前,它实现了一个最小的端到端流程:解析一个狭窄的HTML子集,构建DOM树,从样式标签解析CSS,计算基本样式,推导一个简单的块布局树,并将结果绘制到一个小的文本帧缓冲区。它还包括基本的HTTP/HTTPS获取功能,并支持重定向。 JavaScript执行是通过Boa JavaScript引擎集成的。虽然这仍处于早期阶段,但简单的脚本可以运行。 渲染是从头开始在GPU上完成的,使用了wgpu和Vello,而不依赖于Skia。渲染器使用单个图集和一个简单的管道进行批处理和光栅化。 我们的目标不是构建一个完整的浏览器,而是以小而明确的方式理解和实现管道的核心部分。 接下来的步骤包括改进标记化,扩展CSS支持,使布局不那么原始,并继续在GPU渲染路径上的工作。 当前的渲染快照: [https://imgur.com/a/NtbgR5i](https://imgur.com/a/NtbgR5i)
查看原文
I’ve been building Aurora, an early-stage browser engine in Rust.<p>It currently implements a minimal end-to-end pipeline: parsing a narrow HTML subset, building a DOM tree, parsing CSS from style tags, computing basic styles, deriving a simple block layout tree, and painting the result into a small text framebuffer. It also includes basic HTTP&#x2F;HTTPS fetching with redirect support.<p>JavaScript execution is integrated using the Boa JavaScript engine. This is still early, but simple scripts do run.<p>Rendering is done on the GPU from scratch using wgpu and Vello, without relying on Skia. The renderer uses a single atlas and a simple pipeline for batching and rasterization.<p>The goal is not to build a full browser, but to understand and implement the core pieces of the pipeline in a small and explicit way.<p>Next steps are improving tokenization, expanding CSS support, making layout less primitive, and continuing work on the GPU rendering path.<p>Current render snapshot : <a href="https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;NtbgR5i" rel="nofollow">https:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;NtbgR5i</a>