blog
blog copied to clipboard
Servo 的目录结构
Servo 的目录结构
- components
- bluetooth
- 实现蓝牙线程
- bluetooth_traits
- 考虑到构建速度,提取出来的一些 API
-
canvas
- 实现绘制 2d 和 WebGL 的线程
- canvas_traits
- 考虑到构建速度,提取出来的一些 API
- compositing
- 集成OS窗口/渲染和事件循环
-
constellation
- 管理高级浏览上下文(比如页签)的资源
- devtools
- 进程内服务器,允许通过远程Firefox开发人员工具客户端操作浏览器实例
- devtools_traits
- 考虑到构建速度,提取出来的一些 API
-
gfx
- 绘制布局页面的结果,并将结果发送到合成器
- gfx_traits
- 考虑到构建速度,提取出来的一些 API
-
layout
- 将页面内容转换成定位的样式框,并将结果传送到渲染器
-
layout_thread
- 运行布局线程,并和脚本线程进行通信,同时调用布局包进行布局
- layout_traits
- 考虑到构建速度,提取出来的一些 API
- msg
- 共享API,用于特定线程和crates间的通信
-
net
- 网络协议的实现,状态和资源管理(缓存,cookie等)
- net_traits
- 考虑到构建速度,提取出来的一些 API
- plugins
- 语法扩展,自定义属性和lint
- profile
- 内存和时间的分析器
- profile_traits
- 考虑到构建速度,提取出来的一些 API
-
script
- DOM 的实现(原生 Rust 代码,绑定到 SpiderMonkey)
- script_layout_interface
- 脚本包提供给布局包的 API
- script_traits
- 考虑到构建速度,提取出来的一些 API
-
servo
- 入口,包括 servo 应用程序和 libservo 嵌入库
-
style
- API,为解析 CSS、样式表和样式元素间的交互
- style_traits
- 考虑到构建速度,提取出来的一些 API
- util
- 整个项目中常用的各种实用方法和类型
- webdriver_server
- 进程内服务器,允许通过 WebDriver 客户端操作浏览器实例
- bluetooth
- etc
- 对开发人员有用的工具和脚本
- mach
- 一个帮助开发人员执行任务的命令行工具
- ports
- glutin
-
glutin
窗口库的实现
-
- glutin
- python
- servo
- servo 专用的 mach 命令的实现
- tidy
- 在合并更改之前自动运行的 Python 包代码 lints
- servo
- resources
- 运行时使用的文件。在分发二进制构建时需要以某种方式包含
- support
- android
- 构建 Android 平台时,需要特殊处理的库
- rust-task_info
- 用于获取进程内存使用情况信息的库
- android
- target
- debug
- 构建由
./mach build --debug
生成的东东
- 构建由
- doc
- 当运行
./mach doc
时,由rustdoc
工具生成的文档
- 当运行
- release
- 构建由
./mach build --release
生成的东东
- 构建由
- debug
- tests
- dromaeo
- 自动运行 Dromaeo 测试套件的 Harness
- heartbeats
- 心跳检测的工具
- html
- 手动测试和实验
- jquery
- 自动运行 jQuery 测试套件的 Harness
- power
- 用于测量功耗的工具
- unit
- 单元测试,使用 rust 的内置测试线
- wpt
- W3C web-platform-tests 和 csswg-tests,以及运行它们和预期错误的工具
- dromaeo
主要依赖
- https://github.com/servo/rust-mozjs/, https://github.com/servo/mozjs/: 绑定到 SpiderMonkey
- https://github.com/hyperium/hyper/: HTTP 实现
- https://github.com/servo/html5ever/: HTML5 解析器
- https://github.com/servo/ipc-channel/: IPC 实现(进程间通信)
- https://github.com/PistonDevelopers/image/: 图像解码器
- https://github.com/tomaka/glutin/: 跨平台窗口和输入
- https://github.com/servo/rust-azure/: 绑定到 Moz2D/Azure(跨平台 2D 渲染库)
- https://github.com/servo/rust-cssparser/: CSS 解析器
- https://github.com/servo/rust-selectors/: CSS 选择器匹配库
- https://github.com/cyderize/rust-websocket/: WebSocket 协议实现
- https://github.com/servo/rust-url/: URL 规范的实现
- https://github.com/servo/webrender/: GPU 渲染器
参考
https://github.com/servo/servo/blob/master/docs/ORGANIZATION.md