From 881e4fcd6eeca203d4b7a2ae827129c785c787d5 Mon Sep 17 00:00:00 2001 From: James Graham Date: Tue, 29 Jul 2014 15:38:51 +0100 Subject: [PATCH] Support window.parent in the one-window case. --- src/components/script/dom/webidls/Window.webidl | 1 + src/components/script/dom/window.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/components/script/dom/webidls/Window.webidl b/src/components/script/dom/webidls/Window.webidl index d96083a8aa8..aea9fc784e1 100644 --- a/src/components/script/dom/webidls/Window.webidl +++ b/src/components/script/dom/webidls/Window.webidl @@ -34,6 +34,7 @@ //[Unforgeable] readonly attribute WindowProxy top; // attribute any opener; //readonly attribute WindowProxy parent; + readonly attribute Window parent; //readonly attribute Element? frameElement; //WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", optional DOMString features = "", optional boolean replace = false); //getter WindowProxy (unsigned long index); diff --git a/src/components/script/dom/window.rs b/src/components/script/dom/window.rs index e620a8c40b0..070c2373792 100644 --- a/src/components/script/dom/window.rs +++ b/src/components/script/dom/window.rs @@ -191,6 +191,11 @@ impl<'a> WindowMethods for JSRef<'a, Window> { self.Window() } + fn Parent(&self) -> Temporary { + //TODO - Once we support iframes correctly this needs to return the parent frame + self.Window() + } + fn Performance(&self) -> Temporary { if self.performance.get().is_none() { let performance = Performance::new(self);