mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibWeb: Return FACEs from HTML{FieldSet,Form}Element#elements
This commit is contained in:
Notes:
github-actions[bot]
2026-03-25 13:20:51 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/9af3e348751 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8534 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/tcl3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user