mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 21:45:29 +00:00
LibWeb: Support RadioNodeList named items in HTMLFormControlsCollection
We would previously not return a RadioNodeList in the curious case where a named item resolves to two different elements within the form. This was not a problem when calling namedItem directly in the IDL as named_item_or_radio_node_list shadows named_item but is exposed when calling the property through array bracket notation (as an example). Fix this, and add a bunch more tests to cover HTMLFormControlsCollection.
This commit is contained in:
committed by
Andreas Kling
parent
1defc4595b
commit
ec2b4c271f
@@ -77,4 +77,11 @@ Variant<Empty, Element*, JS::Handle<RadioNodeList>> HTMLFormControlsCollection::
|
||||
}));
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::Value> HTMLFormControlsCollection::named_item_value(FlyString const& name) const
|
||||
{
|
||||
return named_item_or_radio_node_list(name).visit(
|
||||
[](Empty) -> JS::Value { return JS::js_undefined(); },
|
||||
[](auto const& value) -> JS::Value { return value; });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user