LibWeb: Update Window::length() to use navigables

This commit is contained in:
Aliaksandr Kalenik 2023-09-03 22:50:40 +02:00 committed by Andreas Kling
parent 7daa462ef8
commit 089a23a1f2
Notes: sideshowbarker 2024-07-16 22:22:13 +09:00
2 changed files with 3 additions and 3 deletions

View file

@ -880,10 +880,10 @@ JS::NonnullGCPtr<WindowProxy> Window::frames() const
}
// https://html.spec.whatwg.org/multipage/window-object.html#dom-length
u32 Window::length() const
u32 Window::length()
{
// The length getter steps are to return this's associated Document's document-tree child navigables's size.
return static_cast<u32>(document_tree_child_browsing_context_count());
return associated_document().document_tree_child_navigables().size();
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-top

View file

@ -136,7 +136,7 @@ public:
void focus();
JS::NonnullGCPtr<WindowProxy> frames() const;
u32 length() const;
u32 length();
JS::GCPtr<WindowProxy const> top() const;
JS::GCPtr<WindowProxy const> parent() const;
JS::GCPtr<DOM::Element const> frame_element() const;