1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 22:15:07 +00:00

LibWeb: Do not use HTMLFormElement::elements to get submittable elements

HTMLFormElement::elements is not the correct filter for submittable
elements. It includes non-submittable elements (HTMLObjectElement) and
also excludes submittable elements (HTMLInputElements in the "image"
type state, "for historical reasons").
This commit is contained in:
Timothy Flynn 2024-02-18 21:52:27 -05:00 committed by Andreas Kling
parent debb5690ce
commit 986811d2aa
3 changed files with 14 additions and 27 deletions

View file

@ -74,7 +74,7 @@ public:
void add_associated_element(Badge<FormAssociatedElement>, HTMLElement&);
void remove_associated_element(Badge<FormAssociatedElement>, HTMLElement&);
ErrorOr<Vector<JS::NonnullGCPtr<DOM::Element>>> get_submittable_elements();
Vector<JS::NonnullGCPtr<DOM::Element>> get_submittable_elements();
JS::NonnullGCPtr<DOM::HTMLFormControlsCollection> elements() const;
unsigned length() const;
@ -109,8 +109,6 @@ private:
virtual Vector<FlyString> supported_property_names() const override;
virtual bool is_supported_property_index(u32) const override;
ErrorOr<void> populate_vector_with_submittable_elements_in_tree_order(JS::NonnullGCPtr<DOM::Element> element, Vector<JS::NonnullGCPtr<DOM::Element>>& elements);
ErrorOr<String> pick_an_encoding() const;
ErrorOr<void> mutate_action_url(AK::URL parsed_action, Vector<XHR::FormDataEntry> entry_list, String encoding, JS::NonnullGCPtr<Navigable> target_navigable, Bindings::NavigationHistoryBehavior history_handling, UserNavigationInvolvement user_involvement);