mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make EventTypeId reflect DOM inheritance hierarchy
This commit is contained in:
parent
50e1c967e4
commit
d3c60af5c6
4 changed files with 22 additions and 13 deletions
|
@ -11,7 +11,7 @@ use dom::bindings::global::GlobalRef;
|
|||
use dom::bindings::js::{Root, RootedReference};
|
||||
use dom::bindings::utils::{Reflectable, reflect_dom_object};
|
||||
use dom::event::{Event, EventTypeId};
|
||||
use dom::uievent::UIEvent;
|
||||
use dom::uievent::{UIEvent, UIEventTypeId};
|
||||
use dom::window::Window;
|
||||
use msg::constellation_msg;
|
||||
use msg::constellation_msg::{Key, KeyModifiers};
|
||||
|
@ -43,14 +43,14 @@ pub struct KeyboardEvent {
|
|||
|
||||
impl KeyboardEventDerived for Event {
|
||||
fn is_keyboardevent(&self) -> bool {
|
||||
*self.type_id() == EventTypeId::KeyboardEvent
|
||||
*self.type_id() == EventTypeId::UIEvent(UIEventTypeId::KeyboardEvent)
|
||||
}
|
||||
}
|
||||
|
||||
impl KeyboardEvent {
|
||||
fn new_inherited() -> KeyboardEvent {
|
||||
KeyboardEvent {
|
||||
uievent: UIEvent::new_inherited(EventTypeId::KeyboardEvent),
|
||||
uievent: UIEvent::new_inherited(UIEventTypeId::KeyboardEvent),
|
||||
key: Cell::new(None),
|
||||
key_string: RefCell::new("".to_owned()),
|
||||
code: RefCell::new("".to_owned()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue