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 diff --git a/tests/wpt/metadata/html/browsers/the-window-object/name-attribute.window.js.ini b/tests/wpt/metadata/html/browsers/the-window-object/name-attribute.window.js.ini deleted file mode 100644 index 015d05d87e1..00000000000 --- a/tests/wpt/metadata/html/browsers/the-window-object/name-attribute.window.js.ini +++ /dev/null @@ -1,4 +0,0 @@ -[name-attribute.window.html] - [Window object's name IDL attribute] - expected: FAIL -