mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement window.closed
This commit is contained in:
parent
161dc666b0
commit
510bea7a7a
6 changed files with 10 additions and 11 deletions
|
@ -23,7 +23,7 @@
|
|||
//[Replaceable] readonly attribute BarProp toolbar;
|
||||
attribute DOMString status;
|
||||
void close();
|
||||
//readonly attribute boolean closed;
|
||||
readonly attribute boolean closed;
|
||||
//void stop();
|
||||
//void focus();
|
||||
//void blur();
|
||||
|
|
|
@ -505,6 +505,13 @@ impl WindowMethods for Window {
|
|||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-window-closed
|
||||
fn Closed(&self) -> bool {
|
||||
self.window_proxy.get()
|
||||
.map(|ref proxy| proxy.is_browsing_context_discarded())
|
||||
.unwrap_or(true)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-window-close
|
||||
fn Close(&self) {
|
||||
self.main_thread_script_chan()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue