aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/websocket.rs
diff options
context:
space:
mode:
authorArthur Skobara <skobara.arthur@gmail.com>2015-12-20 12:52:28 +0600
committerArthur Skobara <skobara.arthur@gmail.com>2015-12-22 13:47:57 +0600
commitd38771e2708b7beabfb9c31c5bbc288534c20b77 (patch)
tree3d03faf8e0ca346a4def764c648d5b41969ebd83 /components/script/dom/websocket.rs
parentdf087cc6cf4d97c5cc93befec922b38b56e6def7 (diff)
downloadservo-d38771e2708b7beabfb9c31c5bbc288534c20b77.tar.gz
servo-d38771e2708b7beabfb9c31c5bbc288534c20b77.zip
Implement EventTarget::fire_simple_event and EventTarget::fire_simple_event_params
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