-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Autogeneration of style structs
Contact: Emilio Cobos Álvarez
The style system generates a set of Structs as the output of the styling process.
These structs are autogenerated in Servo using python.
But they're maintained manually in Firefox, and there's a lot of unsafe conversion code to make C++ understand the Rust data structures.
The goal of this project is prototype a way to make these structs autogenerated in Firefox. For that, the plan is to make C++ understand Rust types, using the same tool that WebRender's Firefox integration uses, cbindgen, presumably on a crate containing the current style::values
module.
To prototype it, a good idea would be to start with a struct that is small and that doesn't have any fancyness, like nsStyleColor
/ color.mako.rs
.
It may be interesting to finally ditch the mako.rs file and use a toml
manifest that can be read by multiple programs. But the specifics can be discussed further :).
For ease of discussion, and to make hacking on the problem easier, a simplified version of it that doesn't require a Firefox build can be found in emilio/structs-playground.
Feel free to ask questions either:
- #servo on irc.mozilla.org, you can ping
emilio
. - The dev-servo mailing list
- Privately over email.