aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlselectelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmlselectelement.rs')
-rwxr-xr-xcomponents/script/dom/htmlselectelement.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs
index 0ef500ccb1a..f6330b9b65a 100755
--- a/components/script/dom/htmlselectelement.rs
+++ b/components/script/dom/htmlselectelement.rs
@@ -12,6 +12,7 @@ use crate::dom::bindings::codegen::Bindings::HTMLSelectElementBinding::HTMLSelec
use crate::dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use crate::dom::bindings::codegen::UnionTypes::HTMLElementOrLong;
use crate::dom::bindings::codegen::UnionTypes::HTMLOptionElementOrHTMLOptGroupElement;
+use crate::dom::bindings::error::ErrorResult;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::root::{DomRoot, MutNullableDom};
use crate::dom::bindings::str::DOMString;
@@ -203,13 +204,13 @@ impl HTMLSelectElementMethods for HTMLSelectElement {
ValidityState::new(&window, self.upcast())
}
- // Note: this function currently only exists for union.html.
// https://html.spec.whatwg.org/multipage/#dom-select-add
fn Add(
&self,
- _element: HTMLOptionElementOrHTMLOptGroupElement,
- _before: Option<HTMLElementOrLong>,
- ) {
+ element: HTMLOptionElementOrHTMLOptGroupElement,
+ before: Option<HTMLElementOrLong>,
+ ) -> ErrorResult {
+ self.Options().Add(element, before)
}
// https://html.spec.whatwg.org/multipage/#dom-fe-disabled
@@ -281,6 +282,11 @@ impl HTMLSelectElementMethods for HTMLSelectElement {
self.Options().IndexedGetter(index)
}
+ // https://html.spec.whatwg.org/multipage/#dom-select-setter
+ fn IndexedSetter(&self, index: u32, value: Option<&HTMLOptionElement>) -> ErrorResult {
+ self.Options().IndexedSetter(index, value)
+ }
+
// https://html.spec.whatwg.org/multipage/#dom-select-nameditem
fn NamedItem(&self, name: DOMString) -> Option<DomRoot<HTMLOptionElement>> {
self.Options()