1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 19:45:08 +00:00

LibWeb: Implement HTMLFormElement::reset

This patch sets up the necessary infrastructure for implementing reset
algorithms for form-associated controls.
This commit is contained in:
Srikavin Ramkumar 2022-12-22 19:32:20 -05:00 committed by Andreas Kling
parent 2376385f0c
commit 7cc6ffe5b7
4 changed files with 51 additions and 0 deletions

View file

@ -22,9 +22,14 @@ public:
void submit_form(JS::GCPtr<HTMLElement> submitter, bool from_submit_binding = false);
void reset_form();
// NOTE: This is for the JS bindings. Use submit_form instead.
void submit();
// NOTE: This is for the JS bindings. Use submit_form instead.
void reset();
void add_associated_element(Badge<FormAssociatedElement>, HTMLElement&);
void remove_associated_element(Badge<FormAssociatedElement>, HTMLElement&);
@ -38,6 +43,9 @@ private:
bool m_firing_submission_events { false };
// https://html.spec.whatwg.org/multipage/forms.html#locked-for-reset
bool m_locked_for_reset { false };
Vector<JS::GCPtr<HTMLElement>> m_associated_elements;
JS::GCPtr<DOM::HTMLCollection> mutable m_elements;