aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/mod.rs17
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
//! ============
//!