diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-09-04 21:18:52 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-09-04 21:18:52 -0600 |
commit | da0b9d7c0185f0898fd47f5326e8e084d08a2fc0 (patch) | |
tree | 11144be1760256602c3497572f25683efe5a8bed /components/script/dom/mod.rs | |
parent | aeb8dce2d914808e4cdb8589d19ee9968897ed94 (diff) | |
parent | 1830ada4bc869da97674efdd0a464049e80e8647 (diff) | |
download | servo-da0b9d7c0185f0898fd47f5326e8e084d08a2fc0.tar.gz servo-da0b9d7c0185f0898fd47f5326e8e084d08a2fc0.zip |
Auto merge of #7337 - wilmoz:InheritanceDocumentation, r=mbrubeck
Documentation of inheritance in type ids
Aditional documentation about this issue https://github.com/servo/servo/issues/7205
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7337)
<!-- Reviewable:end -->
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 e9bc0716217..a0f436e513b 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 //! ============ //! |