From 1830ada4bc869da97674efdd0a464049e80e8647 Mon Sep 17 00:00:00 2001 From: wilmoz Date: Mon, 24 Aug 2015 12:08:11 -0500 Subject: [PATCH] Documentation of inheritance in type ids --- components/script/dom/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index 663d14784a6..dece1b73d07 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -54,6 +54,23 @@ //! This invariant is enforced by the lint in //! `plugins::lints::inheritance_integrity`. //! +//! The same principle applies to typeids, +//! the derived type enum should +//! use one addititional type (the parent class) because sometimes the parent +//! can be the most-derived class of an object. +//! ```ignore +//! pub enum EventTypeId { +//! UIEvent(UIEventTypeId), +//! //others events +//! } +//! +//! pub enum UIEventTypeId { +//! MouseEvent, +//! KeyboardEvent, +//! UIEvent, //<- parent of MouseEvent and KeyboardEvent +//! } +//! ``` +//! //! Construction //! ============ //!