mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Move WebIDL methods to traits implemented by JSRef types.
This commit is contained in:
parent
dfdda0098a
commit
76783b029e
106 changed files with 3644 additions and 1912 deletions
|
@ -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!()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue