aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/window.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 1a8b5e68c8b..64a01a57baa 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -1160,12 +1160,17 @@ impl WindowMethods for Window {
// https://html.spec.whatwg.org/multipage/#dom-name
fn SetName(&self, name: DOMString) {
- self.window_proxy().set_name(name);
+ if let Some(proxy) = self.undiscarded_window_proxy() {
+ proxy.set_name(name);
+ }
}
// https://html.spec.whatwg.org/multipage/#dom-name
fn Name(&self) -> DOMString {
- self.window_proxy().get_name()
+ match self.undiscarded_window_proxy() {
+ Some(proxy) => proxy.get_name(),
+ None => "".into(),
+ }
}
// https://html.spec.whatwg.org/multipage/#dom-origin