mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
auto merge of #1855 : lpy/servo/issue1842, r=jdm
see #1842 When I tried to use like `datalist.options[0].value`, it returned nothing. So is it implemented?
This commit is contained in:
commit
6270178628
3 changed files with 27 additions and 7 deletions
|
@ -142,7 +142,7 @@ addHTMLElement('HTMLBRElement')
|
|||
addHTMLElement('HTMLCanvasElement')
|
||||
addHTMLElement('HTMLDataElement')
|
||||
addHTMLElement('HTMLDivElement')
|
||||
addHTMLElement('HTMLDataListElement')
|
||||
addHTMLElement('HTMLDataListElement', needsAbstract=['options'])
|
||||
addHTMLElement('HTMLDirectoryElement')
|
||||
addHTMLElement('HTMLDListElement')
|
||||
addHTMLElement('HTMLElement')
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue