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
|
@ -116,42 +116,52 @@ impl MouseEvent {
|
|||
}
|
||||
|
||||
impl<'a> MouseEventMethods for &'a MouseEvent {
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-screenX
|
||||
fn ScreenX(self) -> i32 {
|
||||
self.screen_x.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-screenY
|
||||
fn ScreenY(self) -> i32 {
|
||||
self.screen_y.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-clientX
|
||||
fn ClientX(self) -> i32 {
|
||||
self.client_x.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-clientY
|
||||
fn ClientY(self) -> i32 {
|
||||
self.client_y.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-ctrlKey
|
||||
fn CtrlKey(self) -> bool {
|
||||
self.ctrl_key.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-shiftKey
|
||||
fn ShiftKey(self) -> bool {
|
||||
self.shift_key.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-altKey
|
||||
fn AltKey(self) -> bool {
|
||||
self.alt_key.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-metaKey
|
||||
fn MetaKey(self) -> bool {
|
||||
self.meta_key.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-button
|
||||
fn Button(self) -> i16 {
|
||||
self.button.get()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-relatedTarget
|
||||
fn GetRelatedTarget(self) -> Option<Root<EventTarget>> {
|
||||
self.related_target.get().map(Root::from_rooted)
|
||||
}
|
||||
|
@ -160,6 +170,7 @@ impl<'a> MouseEventMethods for &'a MouseEvent {
|
|||
// - https://github.com/servo/servo/issues/6643
|
||||
// - 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 {
|
||||
if opts::experimental_enabled() {
|
||||
(self.button.get() + 1) as i32
|
||||
|
@ -168,6 +179,7 @@ impl<'a> MouseEventMethods for &'a MouseEvent {
|
|||
}
|
||||
}
|
||||
|
||||
// https://w3c.github.io/uievents/#widl-MouseEvent-initMouseEvent
|
||||
fn InitMouseEvent(self,
|
||||
typeArg: DOMString,
|
||||
canBubbleArg: bool,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue