aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmloptionscollection.rs
diff options
context:
space:
mode:
authorSimon Whitehead <chemnova@gmail.com>2017-02-14 00:49:31 +1100
committerSimon Whitehead <chemnova@gmail.com>2017-02-14 00:49:31 +1100
commit7409031af2a066386c18c8813f80f7fd539fb6be (patch)
tree73d5f0d27de20efe6fe51315cbed9c5ae0269ee3 /components/script/dom/htmloptionscollection.rs
parent357df350456f11e67ecfed43b491ad12ab3aaa34 (diff)
downloadservo-7409031af2a066386c18c8813f80f7fd539fb6be.tar.gz
servo-7409031af2a066386c18c8813f80f7fd539fb6be.zip
Move HTMLSelectElement upcast call into HTMLOptionsCollection constructor. Fixes #15521
Diffstat (limited to 'components/script/dom/htmloptionscollection.rs')
-rw-r--r--components/script/dom/htmloptionscollection.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/htmloptionscollection.rs b/components/script/dom/htmloptionscollection.rs
index 2e4ce0f9a37..95478fc30f3 100644
--- a/components/script/dom/htmloptionscollection.rs
+++ b/components/script/dom/htmloptionscollection.rs
@@ -16,6 +16,7 @@ use dom::bindings::str::DOMString;
use dom::element::Element;
use dom::htmlcollection::{CollectionFilter, HTMLCollection};
use dom::htmloptionelement::HTMLOptionElement;
+use dom::htmlselectelement::HTMLSelectElement;
use dom::node::{document_from_node, Node};
use dom::window::Window;
@@ -25,16 +26,16 @@ pub struct HTMLOptionsCollection {
}
impl HTMLOptionsCollection {
- fn new_inherited(root: &Node, filter: Box<CollectionFilter + 'static>) -> HTMLOptionsCollection {
+ fn new_inherited(select: &HTMLSelectElement, filter: Box<CollectionFilter + 'static>) -> HTMLOptionsCollection {
HTMLOptionsCollection {
- collection: HTMLCollection::new_inherited(root, filter),
+ collection: HTMLCollection::new_inherited(select.upcast(), filter),
}
}
- pub fn new(window: &Window, root: &Node, filter: Box<CollectionFilter + 'static>)
+ pub fn new(window: &Window, select: &HTMLSelectElement, filter: Box<CollectionFilter + 'static>)
-> Root<HTMLOptionsCollection>
{
- reflect_dom_object(box HTMLOptionsCollection::new_inherited(root, filter),
+ reflect_dom_object(box HTMLOptionsCollection::new_inherited(select, filter),
window,
HTMLOptionsCollectionBinding::Wrap)
}