diff options
Diffstat (limited to 'components/script/dom/mod.rs')
-rw-r--r-- | components/script/dom/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index cfa41a1ae19..a5d8e7a707a 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -157,18 +157,18 @@ //! Inheritance and casting //! ======================= //! -//! For all DOM interfaces `Foo` in an inheritance chain, a -//! `dom::bindings::inheritance::FooCast` provides methods to cast -//! to other types in the inheritance chain. For example: +//! All DOM interfaces part of an inheritance chain (i.e. interfaces +//! that derive others or are derived from) implement the trait `Castable` +//! which provides both downcast and upcasts. //! //! ```ignore -//! # use script::dom::bindings::inheritance::{NodeCast, HTMLElementCast}; +//! # use script::dom::bindings::inheritance::Castable; //! # use script::dom::element::Element; //! # use script::dom::node::Node; //! # use script::dom::htmlelement::HTMLElement; //! fn f(element: &Element) { //! let base = element.upcast::<Node>(); -//! let derived = element.downcast::<HTMLElement>(); +//! let derived = element.downcast::<HTMLElement>().unwrap(); //! } //! ``` //! @@ -211,6 +211,7 @@ pub mod types { pub mod activation; pub mod attr; +pub mod beforeunloadevent; mod create; #[allow(unsafe_code)] #[deny(missing_docs, non_snake_case)] |