aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlscriptelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmlscriptelement.rs')
-rw-r--r--components/script/dom/htmlscriptelement.rs23
1 files changed, 2 insertions, 21 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs
index 75d2a0070f2..e1b23f9b2b2 100644
--- a/components/script/dom/htmlscriptelement.rs
+++ b/components/script/dom/htmlscriptelement.rs
@@ -481,11 +481,6 @@ impl HTMLScriptElement {
Ok(script) => script,
};
- // TODO(#12446): beforescriptexecute.
- if self.dispatch_before_script_execute_event() == EventStatus::Canceled {
- return;
- }
-
// Step 3.
let neutralized_doc = if script.external {
debug!("loading external script, url = {}", script.url);
@@ -505,9 +500,10 @@ impl HTMLScriptElement {
// Step 5.a.2.
let window = window_from_node(self);
+ let line_number = if script.external { 1 } else { self.line_number as u32 };
rooted!(in(window.get_cx()) let mut rval = UndefinedValue());
window.upcast::<GlobalScope>().evaluate_script_on_global_with_result(
- &script.text, script.url.as_str(), rval.handle_mut(), self.line_number as u32);
+ &script.text, script.url.as_str(), rval.handle_mut(), line_number);
// Step 6.
document.set_current_script(old_script.r());
@@ -517,9 +513,6 @@ impl HTMLScriptElement {
doc.decr_ignore_destructive_writes_counter();
}
- // TODO(#12446): afterscriptexecute.
- self.dispatch_after_script_execute_event();
-
// Step 8.
if script.external {
self.dispatch_load_event();
@@ -531,18 +524,6 @@ impl HTMLScriptElement {
window.dom_manipulation_task_source().queue_simple_event(self.upcast(), atom!("error"), &window);
}
- pub fn dispatch_before_script_execute_event(&self) -> EventStatus {
- self.dispatch_event(atom!("beforescriptexecute"),
- EventBubbles::Bubbles,
- EventCancelable::Cancelable)
- }
-
- pub fn dispatch_after_script_execute_event(&self) {
- self.dispatch_event(atom!("afterscriptexecute"),
- EventBubbles::Bubbles,
- EventCancelable::NotCancelable);
- }
-
pub fn dispatch_load_event(&self) {
self.dispatch_event(atom!("load"),
EventBubbles::DoesNotBubble,