mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Implement reset algorithm for FACEs
This commit is contained in:
Notes:
github-actions[bot]
2026-03-25 13:21:02 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/80302feec74 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8534 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/tcl3
@@ -14,6 +14,7 @@
|
||||
#include <LibWeb/DOM/Position.h>
|
||||
#include <LibWeb/DOM/SelectionchangeEventDispatching.h>
|
||||
#include <LibWeb/GraphemeEdgeTracker.h>
|
||||
#include <LibWeb/HTML/CustomElements/CustomElementReactionNames.h>
|
||||
#include <LibWeb/HTML/Focus.h>
|
||||
#include <LibWeb/HTML/FormAssociatedElement.h>
|
||||
#include <LibWeb/HTML/HTMLButtonElement.h>
|
||||
@@ -69,6 +70,19 @@ bool FormAssociatedElement::is_resettable() const
|
||||
return form_associated_element_to_html_element().is_form_associated_custom_element();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-core-concepts%3Aconcept-form-reset-control
|
||||
void FormAssociatedElement::reset_algorithm()
|
||||
{
|
||||
// The reset algorithm for form-associated custom elements is to enqueue a custom element callback reaction with
|
||||
// the element, callback name "formResetCallback", and « ».
|
||||
auto& html_element = form_associated_element_to_html_element();
|
||||
if (!html_element.is_form_associated_custom_element())
|
||||
return;
|
||||
|
||||
GC::RootVector<JS::Value> empty_arguments { html_element.heap() };
|
||||
html_element.enqueue_a_custom_element_callback_reaction(CustomElementReactionNames::formResetCallback, move(empty_arguments));
|
||||
}
|
||||
|
||||
void FormAssociatedElement::set_form(HTMLFormElement* form)
|
||||
{
|
||||
if (m_form)
|
||||
|
||||
Reference in New Issue
Block a user