mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement EventTarget::fire_simple_event and EventTarget::fire_simple_event_params
This commit is contained in:
parent
df087cc6cf
commit
d38771e270
8 changed files with 61 additions and 71 deletions
|
@ -15,7 +15,7 @@ use dom::bindings::js::{LayoutJS, Root};
|
|||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::document::Document;
|
||||
use dom::element::AttributeMutation;
|
||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{Node, NodeDamage, document_from_node, window_from_node};
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
|
@ -77,12 +77,7 @@ impl Runnable for ImageResponseHandlerRunnable {
|
|||
|
||||
// Fire image.onload
|
||||
let window = window_from_node(document.r());
|
||||
let event = Event::new(GlobalRef::Window(window.r()),
|
||||
atom!("load"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::NotCancelable);
|
||||
event.fire(element.upcast());
|
||||
|
||||
element.upcast::<EventTarget>().fire_simple_event("load", GlobalRef::Window(window.r()));
|
||||
// Trigger reflow
|
||||
window.add_pending_reflow();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue