diff options
author | wilmoz <wcubasalas@gmail.com> | 2015-08-24 12:08:11 -0500 |
---|---|---|
committer | wilmoz <wcubasalas@gmail.com> | 2015-09-01 21:34:35 -0500 |
commit | 1830ada4bc869da97674efdd0a464049e80e8647 (patch) | |
tree | 75e0e02ea2e4648105a724ab7f241c7d7f6723ab /components/script/dom/mod.rs | |
parent | 524b02dbf7c2d8ef0d3a453124075f7718f7e458 (diff) | |
download | servo-1830ada4bc869da97674efdd0a464049e80e8647.tar.gz servo-1830ada4bc869da97674efdd0a464049e80e8647.zip |
Documentation of inheritance in type ids
Diffstat (limited to 'components/script/dom/mod.rs')
-rw-r--r-- | components/script/dom/mod.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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 //! ============ //! |