mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Implement window.length DOM attribute.
This commit is contained in:
parent
5c4f54c403
commit
ba9975e099
5 changed files with 7 additions and 21 deletions
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue