diff options
author | lpy <pylaurent1314@gmail.com> | 2014-03-08 00:32:34 +0800 |
---|---|---|
committer | lpy <pylaurent1314@gmail.com> | 2014-03-12 11:29:58 +0800 |
commit | a2189ee066e32f3dbaa3e583fdd583dffcb1624e (patch) | |
tree | bdf9d0fa2d6f78485acf351b97dc80a01f22c9e2 /src/components/script | |
parent | af616dba58cbf589b116b9e3cde4429df43e72cd (diff) | |
download | servo-a2189ee066e32f3dbaa3e583fdd583dffcb1624e.tar.gz servo-a2189ee066e32f3dbaa3e583fdd583dffcb1624e.zip |
implement HTMLDataListElement.options
Diffstat (limited to 'src/components/script')
-rw-r--r-- | src/components/script/dom/bindings/codegen/Bindings.conf | 2 | ||||
-rw-r--r-- | src/components/script/dom/htmldatalistelement.rs | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/components/script/dom/bindings/codegen/Bindings.conf b/src/components/script/dom/bindings/codegen/Bindings.conf index 369d08bfdf0..6718071ac7d 100644 --- a/src/components/script/dom/bindings/codegen/Bindings.conf +++ b/src/components/script/dom/bindings/codegen/Bindings.conf @@ -138,7 +138,7 @@ addHTMLElement('HTMLBRElement') addHTMLElement('HTMLCanvasElement') addHTMLElement('HTMLDataElement') addHTMLElement('HTMLDivElement') -addHTMLElement('HTMLDataListElement') +addHTMLElement('HTMLDataListElement', needsAbstract=['options']) addHTMLElement('HTMLDirectoryElement') addHTMLElement('HTMLDListElement') addHTMLElement('HTMLElement') diff --git a/src/components/script/dom/htmldatalistelement.rs b/src/components/script/dom/htmldatalistelement.rs index ef3f91f1702..2a81cce1994 100644 --- a/src/components/script/dom/htmldatalistelement.rs +++ b/src/components/script/dom/htmldatalistelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::codegen::HTMLDataListElementBinding; -use dom::bindings::codegen::InheritTypes::HTMLDataListElementDerived; +use dom::bindings::codegen::InheritTypes::{HTMLDataListElementDerived, NodeCast}; use dom::bindings::js::JS; use dom::document::Document; use dom::element::HTMLDataListElementTypeId; @@ -41,10 +41,10 @@ impl HTMLDataListElement { } impl HTMLDataListElement { - pub fn Options(&self) -> JS<HTMLCollection> { - // FIXME: https://github.com/mozilla/servo/issues/1842 - let doc = self.htmlelement.element.node.owner_doc(); - let doc = doc.get(); - HTMLCollection::new(&doc.window, ~[]) + pub fn Options(&self, abstract_self: &JS<HTMLDataListElement>) -> JS<HTMLCollection> { + let node: JS<Node> = NodeCast::from(abstract_self); + let doc = &self.htmlelement.element.node.owner_doc(); + let window = &doc.get().window; + HTMLCollection::by_tag_name(window, &node, ~"option") } } |