Skip to content

Adding a new WebIDL binding

Josh Matthews edited this page Mar 31, 2014 · 5 revisions
  • Add the new webidl file to src/components/script/dom/webidls
  • Add an entry to Bindings.conf
  • Create your implementation lowercasename.rs in src/components/script/dom - you'll need a #[deriving(Encodable)] struct containing a Reflector at minimum, as well as implementation of the Reflectable trait. Look at blob.rs for a nice, minimal reference.
  • Add your implementation to script.rs to ensure it is compiled.
  • Build, and fix up any compile errors (such as missing methods or incorrect argument types in your new implementation).

There's an example of a simple HTML element addition which deviates a bit from the above steps.

Clone this wiki locally