Move WebIDL methods to traits implemented by JSRef types.

This commit is contained in:
Josh Matthews 2014-04-10 21:29:54 -04:00
parent dfdda0098a
commit 76783b029e
106 changed files with 3644 additions and 1912 deletions

View file

@ -41,16 +41,22 @@ impl HTMLMapElement {
}
}
impl HTMLMapElement {
pub fn Name(&self) -> DOMString {
pub trait HTMLMapElementMethods {
fn Name(&self) -> DOMString;
fn SetName(&mut self, _name: DOMString) -> ErrorResult;
fn Areas(&self) -> Unrooted<HTMLCollection>;
}
impl<'a> HTMLMapElementMethods for JSRef<'a, HTMLMapElement> {
fn Name(&self) -> DOMString {
~""
}
pub fn SetName(&mut self, _name: DOMString) -> ErrorResult {
fn SetName(&mut self, _name: DOMString) -> ErrorResult {
Ok(())
}
pub fn Areas(&self) -> Unrooted<HTMLCollection> {
fn Areas(&self) -> Unrooted<HTMLCollection> {
let roots = RootCollection::new();
// FIXME: https://github.com/mozilla/servo/issues/1845
let doc = self.htmlelement.element.node.owner_doc().root(&roots);
@ -58,3 +64,4 @@ impl HTMLMapElement {
HTMLCollection::new(&*window, Static(vec!()))
}
}