mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add spec links
This commit is contained in:
parent
f039827dcd
commit
233a769c67
61 changed files with 284 additions and 87 deletions
|
@ -761,6 +761,7 @@ impl KeyEventProperties {
|
|||
}
|
||||
|
||||
impl<'a> KeyboardEventMethods for &'a KeyboardEvent {
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-initKeyboardEvent
|
||||
fn InitKeyboardEvent(self,
|
||||
typeArg: DOMString,
|
||||
canBubbleArg: bool,
|
||||
|
@ -783,38 +784,47 @@ impl<'a> KeyboardEventMethods for &'a KeyboardEvent {
|
|||
self.repeat.set(repeat);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-key
|
||||
fn Key(self) -> DOMString {
|
||||
self.key_string.borrow().clone()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-code
|
||||
fn Code(self) -> DOMString {
|
||||
self.code.borrow().clone()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-location
|
||||
fn Location(self) -> u32 {
|
||||
self.location.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-ctrlKey
|
||||
fn CtrlKey(self) -> bool {
|
||||
self.ctrl.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-shiftKey
|
||||
fn ShiftKey(self) -> bool {
|
||||
self.shift.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-altKey
|
||||
fn AltKey(self) -> bool {
|
||||
self.alt.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-metaKey
|
||||
fn MetaKey(self) -> bool {
|
||||
self.meta.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-repeat
|
||||
fn Repeat(self) -> bool {
|
||||
self.repeat.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-isComposing
|
||||
fn IsComposing(self) -> bool {
|
||||
self.is_composing.get()
|
||||
}
|
||||
|
@ -832,14 +842,17 @@ impl<'a> KeyboardEventMethods for &'a KeyboardEvent {
|
|||
}
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-charCode
|
||||
fn CharCode(self) -> u32 {
|
||||
self.char_code.get().unwrap_or(0)
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-keyCode
|
||||
fn KeyCode(self) -> u32 {
|
||||
self.key_code.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-KeyboardEvent-which
|
||||
fn Which(self) -> u32 {
|
||||
self.char_code.get().unwrap_or(self.KeyCode())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue