From cbfba27cf29779bcc3baf6dbccb4ce80391ff92c Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 9 Feb 2015 14:10:56 +0100 Subject: Document the main steps involved in adding a new DOM interface. --- components/script/dom/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'components/script/dom/mod.rs') 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`. +//! //! Accessing DOM objects from layout //! ================================= //! -- cgit v1.2.3