Inline dom::eventdispatcher into dom::event

This commit is contained in:
Anthony Ramine 2017-01-21 15:28:49 +01:00
parent 7aea6e6ea3
commit 7dd5945237
8 changed files with 283 additions and 301 deletions

View file

@ -22,8 +22,7 @@ use dom::bindings::reflector::{DomObject, Reflector};
use dom::bindings::str::DOMString;
use dom::element::Element;
use dom::errorevent::ErrorEvent;
use dom::event::{Event, EventBubbles, EventCancelable};
use dom::eventdispatcher::{EventStatus, dispatch_event};
use dom::event::{Event, EventBubbles, EventCancelable, EventStatus};
use dom::node::document_from_node;
use dom::virtualmethods::VirtualMethods;
use dom::window::Window;
@ -300,11 +299,11 @@ impl EventTarget {
pub fn dispatch_event_with_target(&self,
target: &EventTarget,
event: &Event) -> EventStatus {
dispatch_event(self, Some(target), event)
event.dispatch(self, Some(target))
}
pub fn dispatch_event(&self, event: &Event) -> EventStatus {
dispatch_event(self, None, event)
event.dispatch(self, None)
}
/// https://html.spec.whatwg.org/multipage/#event-handler-attributes:event-handlers-11