Implement window.length DOM attribute.

This commit is contained in:
Jonathan Kingston 2018-06-14 05:52:31 -07:00
parent 5c4f54c403
commit ba9975e099
5 changed files with 7 additions and 21 deletions

View file

@ -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.