aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/websocket.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/websocket.rs')
-rw-r--r--components/script/dom/websocket.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs
index b7a07d494cb..8f008255993 100644
--- a/components/script/dom/websocket.rs
+++ b/components/script/dom/websocket.rs
@@ -498,10 +498,7 @@ impl Runnable for ConnectionEstablishedTask {
// Step 5: Cookies.
// Step 6.
- let event = Event::new(global.r(), atom!("open"),
- EventBubbles::DoesNotBubble,
- EventCancelable::NotCancelable);
- event.fire(ws.upcast());
+ ws.upcast().fire_simple_event("open", global.r());
}
}
@@ -539,11 +536,10 @@ impl Runnable for CloseTask {
ws.full.set(false);
//A Bad close
ws.clean_close.set(false);
- let event = Event::new(global.r(),
- atom!("error"),
- EventBubbles::DoesNotBubble,
- EventCancelable::Cancelable);
- event.fire(ws.upcast());
+ ws.upcast().fire_simple_event_params("error",
+ EventBubbles::DoesNotBubble,
+ EventCancelable::Cancelable,
+ global.r());
}
let reason = ws.reason.borrow().clone();
/*In addition, we also have to fire a close even if error event fired