Skip to content

Truly independent web browser

LibWeb: Root the elements HTMLFormElement collects

Shannon Booth3dcf3ce2e669
diff --git a/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Libraries/LibWeb/HTML/HTMLFormElement.cpp
index 4e0745d264a..d682709a162 100644
--- a/Libraries/LibWeb/HTML/HTMLFormElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLFormElement.cpp
@@ -472,7 +472,7 @@ void HTMLFormElement::reposition_moved_associated_elements(Badge<FormAssociatedE
if (moved_elements.size() == m_associated_elements_in_tree_order.size())
return;
- HashTable<HTMLElement const*> moved_element_set;
+ GC::RootHashTable<HTMLElement const*> moved_element_set;
for (auto const& element : moved_elements)
moved_element_set.set(element.ptr());
@@ -729,9 +729,9 @@ WebIDL::ExceptionOr<bool> HTMLFormElement::report_validity()
}
// https://html.spec.whatwg.org/multipage/forms.html#category-submit
-Vector<GC::Ref<DOM::Element>> HTMLFormElement::get_submittable_elements()
+GC::RootVector<GC::Ref<DOM::Element>> HTMLFormElement::get_submittable_elements()
{
- Vector<GC::Ref<DOM::Element>> submittable_elements;
+ GC::RootVector<GC::Ref<DOM::Element>> submittable_elements;
for (auto const& element : m_associated_elements_in_tree_order) {
if (element->is_submittable())
diff --git a/Libraries/LibWeb/HTML/HTMLFormElement.h b/Libraries/LibWeb/HTML/HTMLFormElement.h
index 5ee633c21c4..fb284a3f522 100644
--- a/Libraries/LibWeb/HTML/HTMLFormElement.h
+++ b/Libraries/LibWeb/HTML/HTMLFormElement.h
@@ -76,7 +76,7 @@ public:
void add_associated_element(Badge<FormAssociatedElement>, HTMLElement&);
void remove_associated_element(Badge<FormAssociatedElement>, HTMLElement&);
- Vector<GC::Ref<DOM::Element>> get_submittable_elements();
+ GC::RootVector<GC::Ref<DOM::Element>> get_submittable_elements();
GC::Ref<HTMLFormControlsCollection> elements() const;
unsigned length() const;