diff options
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/webidls/Window.webidl | 4 | ||||
-rw-r--r-- | components/script/dom/window.rs | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/components/script/dom/webidls/Window.webidl b/components/script/dom/webidls/Window.webidl index 37bba020622..8416cd49334 100644 --- a/components/script/dom/webidls/Window.webidl +++ b/components/script/dom/webidls/Window.webidl @@ -31,14 +31,14 @@ // other browsing contexts [Replaceable] readonly attribute WindowProxy frames; - //[Replaceable] readonly attribute unsigned long length; + [Replaceable] readonly attribute unsigned long length; // Note that this can return null in the case that the browsing context has been discarded. // https://github.com/whatwg/html/issues/2115 [Unforgeable] readonly attribute WindowProxy? top; // attribute any opener; // Note that this can return null in the case that the browsing context has been discarded. // https://github.com/whatwg/html/issues/2115 - readonly attribute WindowProxy? parent; + [Replaceable] readonly attribute WindowProxy? parent; readonly attribute Element? frameElement; //WindowProxy open(optional DOMString url = "about:blank", optional DOMString target = "_blank", // optional DOMString features = "", optional boolean replace = false); diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 756bfb5a555..2db7609bec4 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -694,6 +694,12 @@ impl WindowMethods for Window { self.window_proxy() } + // https://html.spec.whatwg.org/multipage/#accessing-other-browsing-contexts + fn Length(&self) -> u32 { + let doc = self.Document(); + doc.iter_iframes().count() as u32 + } + // https://html.spec.whatwg.org/multipage/#dom-parent fn GetParent(&self) -> Option<DomRoot<WindowProxy>> { // Steps 1-3. |