auto merge of #1213 : jdm/servo/loadevent, r=kmcallister

It's good enough for now, since we don't track document resources at all. Should be good enough for #841.
This commit is contained in:
bors-servo 2013-11-12 01:01:34 -08:00
commit da4ca51049
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;
}