LibWeb: Return FACEs from HTML{FieldSet,Form}Element#elements

This commit is contained in:
Luke Wilde 2026-02-15 19:55:29 +00:00 committed by Sam Atkins
parent e111945611
commit 9af3e34875
Notes: github-actions[bot] 2026-03-25 13:20:51 +00:00
3 changed files with 10 additions and 36 deletions

View file

@ -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;