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
|
@ -12,7 +12,7 @@ use dom::bindings::js::{JS, MutNullableHeap, Root, RootedReference};
|
|||
use dom::bindings::utils::reflect_dom_object;
|
||||
use dom::event::{Event, EventTypeId, EventBubbles, EventCancelable};
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::uievent::UIEvent;
|
||||
use dom::uievent::{UIEvent, UIEventTypeId};
|
||||
use dom::window::Window;
|
||||
use util::opts;
|
||||
use util::str::DOMString;
|
||||
|
@ -37,14 +37,14 @@ pub struct MouseEvent {
|
|||
|
||||
impl MouseEventDerived for Event {
|
||||
fn is_mouseevent(&self) -> bool {
|
||||
*self.type_id() == EventTypeId::MouseEvent
|
||||
*self.type_id() == EventTypeId::UIEvent(UIEventTypeId::MouseEvent)
|
||||
}
|
||||
}
|
||||
|
||||
impl MouseEvent {
|
||||
fn new_inherited() -> MouseEvent {
|
||||
MouseEvent {
|
||||
uievent: UIEvent::new_inherited(EventTypeId::MouseEvent),
|
||||
uievent: UIEvent::new_inherited(UIEventTypeId::MouseEvent),
|
||||
screen_x: Cell::new(0),
|
||||
screen_y: Cell::new(0),
|
||||
client_x: Cell::new(0),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue