Skip to content

Commit 3a59464

Browse files
LibWeb: Resolve two document-tree child browsing context count FIXMEs
This patch makes use of helpers implemented for window.length to resolve two FIXMEs in WindowProxy previously simply assuming no child browsing contexts :^)
1 parent 592fefe commit 3a59464

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Userland/Libraries/LibWeb/Bindings/WindowProxy.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ JS::ThrowCompletionOr<Optional<JS::PropertyDescriptor>> WindowProxy::internal_ge
7474
// 1. Let index be ! ToUint32(P).
7575
auto index = property_key.as_number();
7676

77-
// FIXME: 2. Let maxProperties be the number of document-tree child browsing contexts of W.
78-
size_t max_properties = 0;
77+
// 2. Let maxProperties be the number of document-tree child browsing contexts of W.
78+
auto max_properties = TRY(m_window->document_tree_child_browsing_context_count());
7979

8080
// 3. Let value be undefined.
8181
Optional<JS::Value> value;
@@ -233,8 +233,8 @@ JS::ThrowCompletionOr<JS::MarkedVector<JS::Value>> WindowProxy::internal_own_pro
233233
// 2. Let keys be a new empty List.
234234
auto keys = JS::MarkedVector<JS::Value> { vm.heap() };
235235

236-
// FIXME: 3. Let maxProperties be the number of document-tree child browsing contexts of W.
237-
size_t max_properties = 0;
236+
// 3. Let maxProperties be the number of document-tree child browsing contexts of W.
237+
auto max_properties = TRY(m_window->document_tree_child_browsing_context_count());
238238

239239
// 4. Let index be 0.
240240
// 5. Repeat while index < maxProperties,

0 commit comments

Comments
 (0)