mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Privatize EventTarget and EventListenerEntry
This commit is contained in:
parent
ba073d7e99
commit
df60f8b2c5
82 changed files with 91 additions and 84 deletions
|
@ -59,15 +59,17 @@ impl EventListenerType {
|
|||
|
||||
#[deriving(PartialEq)]
|
||||
#[jstraceable]
|
||||
#[privatize]
|
||||
pub struct EventListenerEntry {
|
||||
pub phase: ListenerPhase,
|
||||
pub listener: EventListenerType
|
||||
phase: ListenerPhase,
|
||||
listener: EventListenerType
|
||||
}
|
||||
|
||||
#[jstraceable]
|
||||
#[must_root]
|
||||
#[privatize]
|
||||
pub struct EventTarget {
|
||||
pub type_id: EventTargetTypeId,
|
||||
type_id: EventTargetTypeId,
|
||||
reflector_: Reflector,
|
||||
handlers: RefCell<HashMap<DOMString, Vec<EventListenerEntry>>>,
|
||||
}
|
||||
|
@ -94,6 +96,11 @@ impl EventTarget {
|
|||
filtered.map(|entry| entry.listener.get_listener()).collect()
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn type_id<'a>(&'a self) -> &'a EventTargetTypeId {
|
||||
&self.type_id
|
||||
}
|
||||
}
|
||||
|
||||
pub trait EventTargetHelpers {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue