mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibWeb: Associate form elements with a form in parsing and dynamically
This makes it available for all form associated elements and not just select and input elements. It also makes it more spec compliant, especially around the form attribute. The main thing missing is re-associating form elements with a form attribute when the form attribute changes or an element with an ID is inserted/removed or has its ID changed.
This commit is contained in:
parent
29f9947ff9
commit
46c0d0f7ae
Notes:
sideshowbarker
2024-07-17 18:04:56 +09:00
Author: https://github.com/Lubrsi
Commit: 46c0d0f7ae
Pull-request: https://github.com/SerenityOS/serenity/pull/12837
9 changed files with 140 additions and 40 deletions
|
@ -191,18 +191,6 @@ bool HTMLInputElement::is_focusable() const
|
|||
return m_text_node;
|
||||
}
|
||||
|
||||
void HTMLInputElement::inserted()
|
||||
{
|
||||
HTMLElement::inserted();
|
||||
set_form(first_ancestor_of_type<HTMLFormElement>());
|
||||
}
|
||||
|
||||
void HTMLInputElement::removed_from(DOM::Node* old_parent)
|
||||
{
|
||||
HTMLElement::removed_from(old_parent);
|
||||
set_form(nullptr);
|
||||
}
|
||||
|
||||
void HTMLInputElement::parse_attribute(FlyString const& name, String const& value)
|
||||
{
|
||||
FormAssociatedElement::parse_attribute(name, value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue