aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/keyboardevent.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/keyboardevent.rs')
-rw-r--r--components/script/dom/keyboardevent.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/components/script/dom/keyboardevent.rs b/components/script/dom/keyboardevent.rs
index 156ab99e899..0153ad214be 100644
--- a/components/script/dom/keyboardevent.rs
+++ b/components/script/dom/keyboardevent.rs
@@ -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())
}