Skip to content

Truly independent web browser

LibWeb: Root a window's document-tree child navigable target name set

Shannon Boothc281071e3194
diff --git a/Libraries/LibWeb/HTML/RemoteWindow.cpp b/Libraries/LibWeb/HTML/RemoteWindow.cpp
index 375ad4ee7ed..2cb34584459 100644
--- a/Libraries/LibWeb/HTML/RemoteWindow.cpp
+++ b/Libraries/LibWeb/HTML/RemoteWindow.cpp
@@ -263,7 +263,7 @@ Vector<GC::Root<Navigable>> RemoteWindow::document_tree_child_navigables()
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#document-tree-child-navigable-target-name-property-set
-OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> RemoteWindow::document_tree_child_navigable_target_name_property_set()
+GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> RemoteWindow::document_tree_child_navigable_target_name_property_set()
{
// The document-tree child navigable target name property set of a Window object window is the return value of running these steps:
@@ -271,7 +271,7 @@ OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> RemoteWindow::document_tree_c
auto children = document_tree_child_navigables();
// 2. Let firstNamedChildren be an empty ordered set.
- OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> first_named_children;
+ GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> first_named_children;
// 3. For each navigable of children:
for (auto const& navigable : children) {
@@ -292,7 +292,7 @@ OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> RemoteWindow::document_tree_c
}
// 4. Let names be an empty ordered set.
- OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> names;
+ GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> names;
// 5. For each navigable of firstNamedChildren:
for (auto const& [name, navigable] : first_named_children) {
diff --git a/Libraries/LibWeb/HTML/RemoteWindow.h b/Libraries/LibWeb/HTML/RemoteWindow.h
index 998f96ad0fb..7ff5f1caacc 100644
--- a/Libraries/LibWeb/HTML/RemoteWindow.h
+++ b/Libraries/LibWeb/HTML/RemoteWindow.h
@@ -48,7 +48,7 @@ public:
WebIDL::ExceptionOr<void> post_message(JS::Realm&, JS::Value message, Window::PostMessageOptions const&);
Vector<GC::Root<Navigable>> document_tree_child_navigables();
- OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> document_tree_child_navigable_target_name_property_set();
+ GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> document_tree_child_navigable_target_name_property_set();
CrossOriginPropertyDescriptorMap& cross_origin_property_descriptor_map() { return m_cross_origin_property_descriptor_map; }
diff --git a/Libraries/LibWeb/HTML/Window.cpp b/Libraries/LibWeb/HTML/Window.cpp
index 43061d01b0f..602f684a0fb 100644
--- a/Libraries/LibWeb/HTML/Window.cpp
+++ b/Libraries/LibWeb/HTML/Window.cpp
@@ -2281,7 +2281,7 @@ GC::Ref<CustomElementRegistry> Window::custom_elements()
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#document-tree-child-navigable-target-name-property-set
-OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> Window::document_tree_child_navigable_target_name_property_set()
+GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> Window::document_tree_child_navigable_target_name_property_set()
{
// The document-tree child navigable target name property set of a Window object window is the return value of running these steps:
@@ -2289,7 +2289,7 @@ OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> Window::document_tree_child_n
auto children = associated_document().document_tree_child_navigables();
// 2. Let firstNamedChildren be an empty ordered set.
- OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> first_named_children;
+ GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> first_named_children;
// 3. For each navigable of children:
for (auto const& navigable : children) {
@@ -2310,7 +2310,7 @@ OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> Window::document_tree_child_n
}
// 4. Let names be an empty ordered set.
- OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> names;
+ GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> names;
// 5. For each navigable of firstNamedChildren:
for (auto const& [name, navigable] : first_named_children) {
diff --git a/Libraries/LibWeb/HTML/Window.h b/Libraries/LibWeb/HTML/Window.h
index 43d53d7f7db..e18243cc4f4 100644
--- a/Libraries/LibWeb/HTML/Window.h
+++ b/Libraries/LibWeb/HTML/Window.h
@@ -305,7 +305,7 @@ public:
static void set_internals_object_exposed(bool);
static bool is_internals_object_exposed();
- [[nodiscard]] OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> document_tree_child_navigable_target_name_property_set();
+ [[nodiscard]] GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> document_tree_child_navigable_target_name_property_set();
[[nodiscard]] Variant<Empty, GC::Ref<WindowProxy>, GC::Ref<DOM::Element>, GC::Ref<DOM::HTMLCollection>> named_item(Utf16FlyString const&) const;
[[nodiscard]] Vector<Utf16FlyString> supported_property_names() const override;
diff --git a/Libraries/LibWeb/HTML/WindowProxy.cpp b/Libraries/LibWeb/HTML/WindowProxy.cpp
index 20064ec5279..d1778cf65e2 100644
--- a/Libraries/LibWeb/HTML/WindowProxy.cpp
+++ b/Libraries/LibWeb/HTML/WindowProxy.cpp
@@ -420,7 +420,7 @@ Vector<GC::Root<Navigable>> WindowProxy::document_tree_child_navigables() const
return m_window->associated_document().document_tree_child_navigables();
}
-OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> WindowProxy::document_tree_child_navigable_target_name_property_set() const
+GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> WindowProxy::document_tree_child_navigable_target_name_property_set() const
{
if (m_remote_window)
return m_remote_window->document_tree_child_navigable_target_name_property_set();
diff --git a/Libraries/LibWeb/HTML/WindowProxy.h b/Libraries/LibWeb/HTML/WindowProxy.h
index 0b8c05e0739..b8972a2119c 100644
--- a/Libraries/LibWeb/HTML/WindowProxy.h
+++ b/Libraries/LibWeb/HTML/WindowProxy.h
@@ -84,7 +84,7 @@ private:
bool is_platform_object_same_origin() const;
Vector<GC::Root<Navigable>> document_tree_child_navigables() const;
- OrderedHashMap<Utf16FlyString, GC::Ref<Navigable>> document_tree_child_navigable_target_name_property_set() const;
+ GC::OrderedRootHashMap<Utf16FlyString, GC::Ref<Navigable>> document_tree_child_navigable_target_name_property_set() const;
Optional<JS::PropertyDescriptor> cross_origin_get_own_property_helper(JS::PropertyKey const&) const;
GC::RootVector<JS::Value> cross_origin_own_property_keys() const;