mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Add KeyboardEvent stub.
This commit is contained in:
parent
1c64dabb15
commit
bb7074698a
9 changed files with 122 additions and 24 deletions
|
@ -21,7 +21,7 @@ use std::default::Default;
|
|||
|
||||
#[dom_struct]
|
||||
pub struct MouseEvent {
|
||||
mouseevent: UIEvent,
|
||||
uievent: UIEvent,
|
||||
screen_x: Cell<i32>,
|
||||
screen_y: Cell<i32>,
|
||||
client_x: Cell<i32>,
|
||||
|
@ -43,7 +43,7 @@ impl MouseEventDerived for Event {
|
|||
impl MouseEvent {
|
||||
fn new_inherited() -> MouseEvent {
|
||||
MouseEvent {
|
||||
mouseevent: UIEvent::new_inherited(MouseEventTypeId),
|
||||
uievent: UIEvent::new_inherited(MouseEventTypeId),
|
||||
screen_x: Cell::new(0),
|
||||
screen_y: Cell::new(0),
|
||||
client_x: Cell::new(0),
|
||||
|
@ -91,13 +91,13 @@ impl MouseEvent {
|
|||
type_: DOMString,
|
||||
init: &MouseEventBinding::MouseEventInit) -> Fallible<Temporary<MouseEvent>> {
|
||||
let event = MouseEvent::new(global.as_window(), type_,
|
||||
init.parent.parent.bubbles,
|
||||
init.parent.parent.cancelable,
|
||||
init.parent.view.root_ref(),
|
||||
init.parent.detail,
|
||||
init.parent.parent.parent.bubbles,
|
||||
init.parent.parent.parent.cancelable,
|
||||
init.parent.parent.view.root_ref(),
|
||||
init.parent.parent.detail,
|
||||
init.screenX, init.screenY,
|
||||
init.clientX, init.clientY, init.ctrlKey,
|
||||
init.altKey, init.shiftKey, init.metaKey,
|
||||
init.clientX, init.clientY, init.parent.ctrlKey,
|
||||
init.parent.altKey, init.parent.shiftKey, init.parent.metaKey,
|
||||
init.button, init.relatedTarget.root_ref());
|
||||
Ok(event)
|
||||
}
|
||||
|
@ -178,6 +178,6 @@ impl<'a> MouseEventMethods for JSRef<'a, MouseEvent> {
|
|||
|
||||
impl Reflectable for MouseEvent {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
self.mouseevent.reflector()
|
||||
self.uievent.reflector()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue