diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-02-09 14:10:56 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-02-09 14:10:56 +0100 |
commit | cbfba27cf29779bcc3baf6dbccb4ce80391ff92c (patch) | |
tree | 10fd3490c0bb3345c58d59e33326d36c321a8691 /components/script/dom/mod.rs | |
parent | 83a6b5d7705facb9c3fe56d8adeffb2e136231e8 (diff) | |
download | servo-cbfba27cf29779bcc3baf6dbccb4ce80391ff92c.tar.gz servo-cbfba27cf29779bcc3baf6dbccb4ce80391ff92c.zip |
Document the main steps involved in adding a new DOM interface.
Diffstat (limited to 'components/script/dom/mod.rs')
-rw-r--r-- | components/script/dom/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index 0650a900494..f53ef704e48 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -156,6 +156,20 @@ //! } //! ``` //! +//! Adding a new DOM interface +//! ========================== +//! +//! Adding a new interface `Foo` requires at least the following: +//! +//! * adding the new IDL file at `components/script/dom/webidls/Foo.webidl`; +//! * creating `components/script/dom/foo.rs`; +//! * listing `foo.rs` in components/script/dom/mod.rs`; +//! * defining the DOM struct `Foo` with a `#[dom_struct]` attribute, a +//! superclass or `Reflector` member, and other members as appropriate; +//! * implementing the +//! `dom::bindings::codegen::Bindings::FooBindings::FooMethods` trait for +//! `JSRef<Foo>`. +//! //! Accessing DOM objects from layout //! ================================= //! |