1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +00:00

LibWeb: Implement HTMLFormElement::get_submittable_elements()

This implements a convenience method on HTMLFormElement to retrieve a
list in tree order of submittable elements associated with the form
element.
This commit is contained in:
Kenneth Myhra 2023-02-03 21:50:14 +01:00 committed by Linus Groh
parent a6cdf6374f
commit 2363c2a572
2 changed files with 31 additions and 0 deletions

View file

@ -34,6 +34,8 @@ public:
void add_associated_element(Badge<FormAssociatedElement>, HTMLElement&);
void remove_associated_element(Badge<FormAssociatedElement>, HTMLElement&);
ErrorOr<Vector<JS::NonnullGCPtr<DOM::Element>>> get_submittable_elements();
JS::NonnullGCPtr<DOM::HTMLCollection> elements() const;
unsigned length() const;
@ -46,6 +48,8 @@ private:
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
ErrorOr<void> populate_vector_with_submittable_elements_in_tree_order(JS::NonnullGCPtr<DOM::Element> element, Vector<JS::NonnullGCPtr<DOM::Element>>& elements);
bool m_firing_submission_events { false };
// https://html.spec.whatwg.org/multipage/forms.html#locked-for-reset