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
43
components/script/dom/keyboardevent.rs
Normal file
43
components/script/dom/keyboardevent.rs
Normal file
|
@ -0,0 +1,43 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::Bindings::KeyboardEventBinding;
|
||||
use dom::bindings::codegen::Bindings::KeyboardEventBinding::KeyboardEventMethods;
|
||||
use dom::bindings::codegen::InheritTypes::KeyboardEventDerived;
|
||||
use dom::bindings::error::Fallible;
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::{JSRef, Temporary};
|
||||
use dom::bindings::utils::{Reflectable, Reflector/*, reflect_dom_object*/};
|
||||
use dom::event::{Event, KeyboardEventTypeId};
|
||||
use dom::uievent::UIEvent;
|
||||
use servo_util::str::DOMString;
|
||||
|
||||
#[jstraceable]
|
||||
#[must_root]
|
||||
pub struct KeyboardEvent {
|
||||
uievent: UIEvent,
|
||||
}
|
||||
|
||||
impl KeyboardEventDerived for Event {
|
||||
fn is_keyboardevent(&self) -> bool {
|
||||
*self.type_id() == KeyboardEventTypeId
|
||||
}
|
||||
}
|
||||
|
||||
impl KeyboardEvent {
|
||||
pub fn Constructor(_global: &GlobalRef,
|
||||
_type_: DOMString,
|
||||
_init: &KeyboardEventBinding::KeyboardEventInit) -> Fallible<Temporary<KeyboardEvent>> {
|
||||
fail!()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> KeyboardEventMethods for JSRef<'a, KeyboardEvent> {
|
||||
}
|
||||
|
||||
impl Reflectable for KeyboardEvent {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
self.uievent.reflector()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue