diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/webidls/Window.webidl | 2 | ||||
-rw-r--r-- | components/script/dom/window.rs | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/components/script/dom/webidls/Window.webidl b/components/script/dom/webidls/Window.webidl index 0cda7d2d800..8416cd49334 100644 --- a/components/script/dom/webidls/Window.webidl +++ b/components/script/dom/webidls/Window.webidl @@ -31,7 +31,7 @@ // 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; 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. |