Make the traits for the IDL interfaces take &self

This commit is contained in:
Anthony Ramine 2015-08-27 22:15:54 +02:00
parent 856fda7f2e
commit 709d347872
99 changed files with 1192 additions and 1192 deletions

View file

@ -114,54 +114,54 @@ impl MouseEvent {
}
}
impl<'a> MouseEventMethods for &'a MouseEvent {
impl MouseEventMethods for MouseEvent {
// https://w3c.github.io/uievents/#widl-MouseEvent-screenX
fn ScreenX(self) -> i32 {
fn ScreenX(&self) -> i32 {
self.screen_x.get()
}
// https://w3c.github.io/uievents/#widl-MouseEvent-screenY
fn ScreenY(self) -> i32 {
fn ScreenY(&self) -> i32 {
self.screen_y.get()
}
// https://w3c.github.io/uievents/#widl-MouseEvent-clientX
fn ClientX(self) -> i32 {
fn ClientX(&self) -> i32 {
self.client_x.get()
}
// https://w3c.github.io/uievents/#widl-MouseEvent-clientY
fn ClientY(self) -> i32 {
fn ClientY(&self) -> i32 {
self.client_y.get()
}
// https://w3c.github.io/uievents/#widl-MouseEvent-ctrlKey
fn CtrlKey(self) -> bool {
fn CtrlKey(&self) -> bool {
self.ctrl_key.get()
}
// https://w3c.github.io/uievents/#widl-MouseEvent-shiftKey
fn ShiftKey(self) -> bool {
fn ShiftKey(&self) -> bool {
self.shift_key.get()
}
// https://w3c.github.io/uievents/#widl-MouseEvent-altKey
fn AltKey(self) -> bool {
fn AltKey(&self) -> bool {
self.alt_key.get()
}
// https://w3c.github.io/uievents/#widl-MouseEvent-metaKey
fn MetaKey(self) -> bool {
fn MetaKey(&self) -> bool {
self.meta_key.get()
}
// https://w3c.github.io/uievents/#widl-MouseEvent-button
fn Button(self) -> i16 {
fn Button(&self) -> i16 {
self.button.get()
}
// https://w3c.github.io/uievents/#widl-MouseEvent-relatedTarget
fn GetRelatedTarget(self) -> Option<Root<EventTarget>> {
fn GetRelatedTarget(&self) -> Option<Root<EventTarget>> {
self.related_target.get().map(Root::from_rooted)
}
@ -170,7 +170,7 @@ impl<'a> MouseEventMethods for &'a MouseEvent {
// - https://bugzilla.mozilla.org/show_bug.cgi?id=1186125
// This returns the same result as current gecko.
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which
fn Which(self) -> i32 {
fn Which(&self) -> i32 {
if opts::experimental_enabled() {
(self.button.get() + 1) as i32
} else {
@ -179,7 +179,7 @@ impl<'a> MouseEventMethods for &'a MouseEvent {
}
// https://w3c.github.io/uievents/#widl-MouseEvent-initMouseEvent
fn InitMouseEvent(self,
fn InitMouseEvent(&self,
typeArg: DOMString,
canBubbleArg: bool,
cancelableArg: bool,