HTMLOptionElement.index

This commit is contained in:
Patrick Shaughnessy 2020-01-01 17:00:39 -05:00
parent c6192dc286
commit 767ccbe568
5 changed files with 43 additions and 25 deletions

View file

@ -102,7 +102,7 @@ impl HTMLSelectElement {
}
// https://html.spec.whatwg.org/multipage/#concept-select-option-list
fn list_of_options(&self) -> impl Iterator<Item = DomRoot<HTMLOptionElement>> {
pub fn list_of_options(&self) -> impl Iterator<Item = DomRoot<HTMLOptionElement>> {
self.upcast::<Node>().children().flat_map(|node| {
if node.is::<HTMLOptionElement>() {
let node = DomRoot::downcast::<HTMLOptionElement>(node).unwrap();