Add a spec-incompliant load event.

This commit is contained in:
Josh Matthews 2013-11-11 16:50:58 +09:00
parent 651b2f072b
commit 3b3f891455
4 changed files with 54 additions and 3 deletions

View file

@ -9,12 +9,14 @@ use dom::node::AbstractNode;
use servo_util::tree::{TreeNodeRef};
// See http://dom.spec.whatwg.org/#concept-event-dispatch for the full dispatch algorithm
pub fn dispatch_event(target: AbstractEventTarget, event: AbstractEvent) -> bool {
pub fn dispatch_event(target: AbstractEventTarget,
pseudo_target: Option<AbstractEventTarget>,
event: AbstractEvent) -> bool {
assert!(!event.event().dispatching);
{
let event = event.mut_event();
event.target = Some(target);
event.target = Some(pseudo_target.unwrap_or(target));
event.dispatching = true;
}