mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Introduce Reflectable::global_scope
This commit is contained in:
parent
27f100b1d4
commit
ae6af5172b
30 changed files with 116 additions and 120 deletions
|
@ -535,8 +535,6 @@ impl Runnable for CloseTask {
|
|||
|
||||
fn handler(self: Box<Self>) {
|
||||
let ws = self.address.root();
|
||||
let ws = ws.r();
|
||||
let global = ws.global();
|
||||
|
||||
if ws.ready_state.get() == WebSocketRequestState::Closed {
|
||||
// Do nothing if already closed.
|
||||
|
@ -558,7 +556,7 @@ impl Runnable for CloseTask {
|
|||
let clean_close = !self.failed;
|
||||
let code = self.code.unwrap_or(close_code::NO_STATUS);
|
||||
let reason = DOMString::from(self.reason.unwrap_or("".to_owned()));
|
||||
let close_event = CloseEvent::new(global.r().as_global_scope(),
|
||||
let close_event = CloseEvent::new(&ws.global_scope(),
|
||||
atom!("close"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::NotCancelable,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue