mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
LibWeb: Return FACEs from HTML{FieldSet,Form}Element#elements
This commit is contained in:
parent
e111945611
commit
9af3e34875
Notes:
github-actions[bot]
2026-03-25 13:20:51 +00:00
Author: https://github.com/Lubrsi
Commit: 9af3e34875
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8534
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/tcl3
3 changed files with 10 additions and 36 deletions
|
|
@ -78,14 +78,10 @@ GC::Ptr<DOM::HTMLCollection> const& HTMLFieldSetElement::elements()
|
|||
// The elements IDL attribute must return an HTMLCollection rooted at the fieldset element, whose filter matches listed elements.
|
||||
if (!m_elements) {
|
||||
m_elements = DOM::HTMLCollection::create(*this, DOM::HTMLCollection::Scope::Descendants, [](DOM::Element const& element) {
|
||||
// FIXME: Form-associated custom elements return also true
|
||||
return is<HTMLButtonElement>(element)
|
||||
|| is<HTMLFieldSetElement>(element)
|
||||
|| is<HTMLInputElement>(element)
|
||||
|| is<HTMLObjectElement>(element)
|
||||
|| is<HTMLOutputElement>(element)
|
||||
|| is<HTMLSelectElement>(element)
|
||||
|| is<HTMLTextAreaElement>(element);
|
||||
if (auto const* form_associated_element = as_if<FormAssociatedElement>(element); form_associated_element && form_associated_element->is_listed())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
return m_elements;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue