mirror of
https://github.com/servo/servo
synced 2026-04-30 19:37:43 +02:00
@@ -18,6 +18,7 @@ use dom::bindings::str::DOMString;
|
||||
use dom::document::Document;
|
||||
use dom::element::{AttributeMutation, Element, ElementCreator};
|
||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||
use dom::eventdispatcher::EventStatus;
|
||||
use dom::htmlelement::HTMLElement;
|
||||
use dom::node::{ChildrenMutation, CloneChildrenFlag, Node};
|
||||
use dom::node::{document_from_node, window_from_node};
|
||||
@@ -444,7 +445,7 @@ impl HTMLScriptElement {
|
||||
}
|
||||
|
||||
// TODO(#12446): beforescriptexecute.
|
||||
if !self.dispatch_before_script_execute_event() {
|
||||
if self.dispatch_before_script_execute_event() == EventStatus::Canceled {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -491,7 +492,7 @@ impl HTMLScriptElement {
|
||||
window.dom_manipulation_task_source().queue_simple_event(self.upcast(), atom!("error"), window.r());
|
||||
}
|
||||
|
||||
pub fn dispatch_before_script_execute_event(&self) -> bool {
|
||||
pub fn dispatch_before_script_execute_event(&self) -> EventStatus {
|
||||
self.dispatch_event(atom!("beforescriptexecute"),
|
||||
EventBubbles::Bubbles,
|
||||
EventCancelable::Cancelable)
|
||||
@@ -562,7 +563,7 @@ impl HTMLScriptElement {
|
||||
fn dispatch_event(&self,
|
||||
type_: Atom,
|
||||
bubbles: EventBubbles,
|
||||
cancelable: EventCancelable) -> bool {
|
||||
cancelable: EventCancelable) -> EventStatus {
|
||||
let window = window_from_node(self);
|
||||
let window = window.r();
|
||||
let event = Event::new(GlobalRef::Window(window), type_, bubbles, cancelable);
|
||||
|
||||
Reference in New Issue
Block a user