mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Make the traits for the IDL interfaces take &self
This commit is contained in:
parent
856fda7f2e
commit
709d347872
99 changed files with 1192 additions and 1192 deletions
|
@ -757,9 +757,9 @@ impl KeyEventProperties {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> KeyboardEventMethods for &'a KeyboardEvent {
|
||||
impl KeyboardEventMethods for KeyboardEvent {
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-initKeyboardEvent
|
||||
fn InitKeyboardEvent(self,
|
||||
fn InitKeyboardEvent(&self,
|
||||
typeArg: DOMString,
|
||||
canBubbleArg: bool,
|
||||
cancelableArg: bool,
|
||||
|
@ -782,52 +782,52 @@ impl<'a> KeyboardEventMethods for &'a KeyboardEvent {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-key
|
||||
fn Key(self) -> DOMString {
|
||||
fn Key(&self) -> DOMString {
|
||||
self.key_string.borrow().clone()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-code
|
||||
fn Code(self) -> DOMString {
|
||||
fn Code(&self) -> DOMString {
|
||||
self.code.borrow().clone()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-location
|
||||
fn Location(self) -> u32 {
|
||||
fn Location(&self) -> u32 {
|
||||
self.location.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-ctrlKey
|
||||
fn CtrlKey(self) -> bool {
|
||||
fn CtrlKey(&self) -> bool {
|
||||
self.ctrl.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-shiftKey
|
||||
fn ShiftKey(self) -> bool {
|
||||
fn ShiftKey(&self) -> bool {
|
||||
self.shift.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-altKey
|
||||
fn AltKey(self) -> bool {
|
||||
fn AltKey(&self) -> bool {
|
||||
self.alt.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-metaKey
|
||||
fn MetaKey(self) -> bool {
|
||||
fn MetaKey(&self) -> bool {
|
||||
self.meta.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-repeat
|
||||
fn Repeat(self) -> bool {
|
||||
fn Repeat(&self) -> bool {
|
||||
self.repeat.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-isComposing
|
||||
fn IsComposing(self) -> bool {
|
||||
fn IsComposing(&self) -> bool {
|
||||
self.is_composing.get()
|
||||
}
|
||||
|
||||
// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/DOM3-Events.html#widl-KeyboardEvent-getModifierState
|
||||
fn GetModifierState(self, keyArg: DOMString) -> bool {
|
||||
fn GetModifierState(&self, keyArg: DOMString) -> bool {
|
||||
match &*keyArg {
|
||||
"Ctrl" => self.CtrlKey(),
|
||||
"Alt" => self.AltKey(),
|
||||
|
@ -840,17 +840,17 @@ impl<'a> KeyboardEventMethods for &'a KeyboardEvent {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-charCode
|
||||
fn CharCode(self) -> u32 {
|
||||
fn CharCode(&self) -> u32 {
|
||||
self.char_code.get().unwrap_or(0)
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-keyCode
|
||||
fn KeyCode(self) -> u32 {
|
||||
fn KeyCode(&self) -> u32 {
|
||||
self.key_code.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-which
|
||||
fn Which(self) -> u32 {
|
||||
fn Which(&self) -> u32 {
|
||||
self.char_code.get().unwrap_or(self.KeyCode())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue