aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlscriptelement.rs
diff options
context:
space:
mode:
authorAdolfo Ochagavía <aochagavia92@gmail.com>2016-09-23 17:51:24 +0200
committerAdolfo Ochagavía <aochagavia92@gmail.com>2016-09-26 17:52:38 +0200
commit6c8bfdb77467314d9b9cc77e16c7d938794a445f (patch)
tree9aaab0d3968e53376981828c3f077a0bbb181916 /components/script/dom/htmlscriptelement.rs
parent821797d6f7728b512ffd8f59053f9040744e2c53 (diff)
downloadservo-6c8bfdb77467314d9b9cc77e16c7d938794a445f.tar.gz
servo-6c8bfdb77467314d9b9cc77e16c7d938794a445f.zip
Return an enum instead of a boolean from dispatch_event
Fixes #13196
Diffstat (limited to 'components/script/dom/htmlscriptelement.rs')
-rw-r--r--components/script/dom/htmlscriptelement.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index 11f4451ad50..288bc8f3a30 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -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);