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

@ -40,20 +40,28 @@ impl HTMLBaseElement {
}
}
impl HTMLBaseElement {
pub fn Href(&self) -> DOMString {
pub trait HTMLBaseElementMethods {
fn Href(&self) -> DOMString;
fn SetHref(&self, _href: DOMString) -> ErrorResult;
fn Target(&self) -> DOMString;
fn SetTarget(&self, _target: DOMString) -> ErrorResult;
}
impl<'a> HTMLBaseElementMethods for JSRef<'a, HTMLBaseElement> {
fn Href(&self) -> DOMString {
~""
}
pub fn SetHref(&self, _href: DOMString) -> ErrorResult {
fn SetHref(&self, _href: DOMString) -> ErrorResult {
Ok(())
}
pub fn Target(&self) -> DOMString {
fn Target(&self) -> DOMString {
~""
}
pub fn SetTarget(&self, _target: DOMString) -> ErrorResult {
fn SetTarget(&self, _target: DOMString) -> ErrorResult {
Ok(())
}
}