mirror of
https://github.com/servo/servo
synced 2026-05-01 11:57:31 +02:00
script: Implement HTMLSelectElement.selectedOptions (#43017)
This introduces a `CollectionSource` trait as an alternative to `CollectionFilter` in `HTMLCollection`, allowing collections to provide elements directly via a custom iterator rather than filtering a full subtree traversal, which would otherwise be rather inefficient for smaller iterable sequences of options that can be determined without traversing the whole subtree again. The newly implemented `selectedOptions` attribute on the `<select>` element uses this to iterate only the element's list of options that are marked as selected. Testing: 14 assertions in the existing WPT went from failing to passing. Fixes #15522. --------- Signed-off-by: Jacob Adam <software@jacobadam.net>
This commit is contained in:
@@ -37,7 +37,7 @@ interface HTMLSelectElement : HTMLElement {
|
||||
undefined remove(long index);
|
||||
[CEReactions, Throws] setter undefined (unsigned long index, HTMLOptionElement? option);
|
||||
|
||||
// readonly attribute HTMLCollection selectedOptions;
|
||||
[SameObject] readonly attribute HTMLCollection selectedOptions;
|
||||
attribute long selectedIndex;
|
||||
attribute DOMString value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user