mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 16:58:52 +00:00
LibWeb: Register FormAssociatedElement with their owner form
This will eventually allow us to implement HTMLFormControlsCollection.
This commit is contained in:
parent
e454e1a45d
commit
78733417a4
Notes:
sideshowbarker
2024-07-18 19:19:19 +09:00
Author: https://github.com/awesomekling
Commit: 78733417a4
6 changed files with 32 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -148,4 +148,14 @@ void HTMLFormElement::submit()
|
|||
submit_form(this, true);
|
||||
}
|
||||
|
||||
void HTMLFormElement::add_associated_element(Badge<FormAssociatedElement>, HTMLElement& element)
|
||||
{
|
||||
m_associated_elements.append(element);
|
||||
}
|
||||
|
||||
void HTMLFormElement::remove_associated_element(Badge<FormAssociatedElement>, HTMLElement& element)
|
||||
{
|
||||
m_associated_elements.remove_first_matching([&](auto& entry) { return entry.ptr() == &element; });
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue