diff options
author | Jonathan Kingston <jonathan@jooped.co.uk> | 2018-06-14 05:52:31 -0700 |
---|---|---|
committer | Jonathan Kingston <jonathan@jooped.co.uk> | 2018-06-14 05:56:16 -0700 |
commit | ba9975e0991b700e7560dfc81c00ae4d77136aa2 (patch) | |
tree | dc478bc40060c377fb699897b53345e0bf58506d /components/script/dom/window.rs | |
parent | 5c4f54c4035d316eba55eda0186e2f2e010042d5 (diff) | |
download | servo-ba9975e0991b700e7560dfc81c00ae4d77136aa2.tar.gz servo-ba9975e0991b700e7560dfc81c00ae4d77136aa2.zip |
Implement window.length DOM attribute.
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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. |