diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-08-27 22:15:54 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-08-27 22:27:43 +0200 |
commit | 709d347872e37ab2358e057d24557b9977238ecd (patch) | |
tree | 89f726bf207325eea8a8ca316f6d77d8c88432cb /components/script/dom/event.rs | |
parent | 856fda7f2e3fe4abd6de247e8bdaf8cedf3764c2 (diff) | |
download | servo-709d347872e37ab2358e057d24557b9977238ecd.tar.gz servo-709d347872e37ab2358e057d24557b9977238ecd.zip |
Make the traits for the IDL interfaces take &self
Diffstat (limited to 'components/script/dom/event.rs')
-rw-r--r-- | components/script/dom/event.rs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs index 320486cf1db..58b45932cd8 100644 --- a/components/script/dom/event.rs +++ b/components/script/dom/event.rs @@ -172,67 +172,67 @@ impl Event { } } -impl<'a> EventMethods for &'a Event { +impl EventMethods for Event { // https://dom.spec.whatwg.org/#dom-event-eventphase - fn EventPhase(self) -> u16 { + fn EventPhase(&self) -> u16 { self.phase.get() as u16 } // https://dom.spec.whatwg.org/#dom-event-type - fn Type(self) -> DOMString { + fn Type(&self) -> DOMString { self.type_.borrow().clone() } // https://dom.spec.whatwg.org/#dom-event-target - fn GetTarget(self) -> Option<Root<EventTarget>> { + fn GetTarget(&self) -> Option<Root<EventTarget>> { self.target.get().map(Root::from_rooted) } // https://dom.spec.whatwg.org/#dom-event-currenttarget - fn GetCurrentTarget(self) -> Option<Root<EventTarget>> { + fn GetCurrentTarget(&self) -> Option<Root<EventTarget>> { self.current_target.get().map(Root::from_rooted) } // https://dom.spec.whatwg.org/#dom-event-defaultprevented - fn DefaultPrevented(self) -> bool { + fn DefaultPrevented(&self) -> bool { self.canceled.get() } // https://dom.spec.whatwg.org/#dom-event-preventdefault - fn PreventDefault(self) { + fn PreventDefault(&self) { if self.cancelable.get() { self.canceled.set(true) } } // https://dom.spec.whatwg.org/#dom-event-stoppropagation - fn StopPropagation(self) { + fn StopPropagation(&self) { self.stop_propagation.set(true); } // https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation - fn StopImmediatePropagation(self) { + fn StopImmediatePropagation(&self) { self.stop_immediate.set(true); self.stop_propagation.set(true); } // https://dom.spec.whatwg.org/#dom-event-bubbles - fn Bubbles(self) -> bool { + fn Bubbles(&self) -> bool { self.bubbles.get() } // https://dom.spec.whatwg.org/#dom-event-cancelable - fn Cancelable(self) -> bool { + fn Cancelable(&self) -> bool { self.cancelable.get() } // https://dom.spec.whatwg.org/#dom-event-timestamp - fn TimeStamp(self) -> u64 { + fn TimeStamp(&self) -> u64 { self.timestamp } // https://dom.spec.whatwg.org/#dom-event-initevent - fn InitEvent(self, + fn InitEvent(&self, type_: DOMString, bubbles: bool, cancelable: bool) { @@ -252,7 +252,7 @@ impl<'a> EventMethods for &'a Event { } // https://dom.spec.whatwg.org/#dom-event-istrusted - fn IsTrusted(self) -> bool { + fn IsTrusted(&self) -> bool { self.trusted.get() } } |