From 75ac47dbd8cdc2b86f04e5a6d43bfbeb77c4cdee Mon Sep 17 00:00:00 2001 From: networkException Date: Tue, 6 Sep 2022 19:56:44 +0200 Subject: [PATCH] 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 :^) --- Userland/Libraries/LibWeb/Bindings/WindowProxy.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/Bindings/WindowProxy.cpp b/Userland/Libraries/LibWeb/Bindings/WindowProxy.cpp index c93bb37cbf..8b535cff14 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowProxy.cpp +++ b/Userland/Libraries/LibWeb/Bindings/WindowProxy.cpp @@ -72,8 +72,8 @@ JS::ThrowCompletionOr> WindowProxy::internal_ge // 1. Let index be ! ToUint32(P). auto index = property_key.as_number(); - // FIXME: 2. Let maxProperties be the number of document-tree child browsing contexts of W. - size_t max_properties = 0; + // 2. Let maxProperties be the number of document-tree child browsing contexts of W. + auto max_properties = TRY(m_window->document_tree_child_browsing_context_count()); // 3. Let value be undefined. Optional value; @@ -227,8 +227,8 @@ JS::ThrowCompletionOr> WindowProxy::internal_own_pro // 2. Let keys be a new empty List. auto keys = JS::MarkedVector { vm.heap() }; - // FIXME: 3. Let maxProperties be the number of document-tree child browsing contexts of W. - size_t max_properties = 0; + // 3. Let maxProperties be the number of document-tree child browsing contexts of W. + auto max_properties = TRY(m_window->document_tree_child_browsing_context_count()); // 4. Let index be 0. // 5. Repeat while index < maxProperties,