Add spec links

This commit is contained in:
Bogdan Cuza 2015-07-21 18:53:01 +03:00 committed by Bogdan
parent f039827dcd
commit 233a769c67
61 changed files with 284 additions and 87 deletions

View file

@ -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())
}