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 HTMLCanvasElement {
}
}
impl HTMLCanvasElement {
pub fn Width(&self) -> u32 {
pub trait HTMLCanvasElementMethods {
fn Width(&self) -> u32;
fn SetWidth(&mut self, _width: u32) -> ErrorResult;
fn Height(&self) -> u32;
fn SetHeight(&mut self, _height: u32) -> ErrorResult;
}
impl<'a> HTMLCanvasElementMethods for JSRef<'a, HTMLCanvasElement> {
fn Width(&self) -> u32 {
0
}
pub fn SetWidth(&mut self, _width: u32) -> ErrorResult {
fn SetWidth(&mut self, _width: u32) -> ErrorResult {
Ok(())
}
pub fn Height(&self) -> u32 {
fn Height(&self) -> u32 {
0
}
pub fn SetHeight(&mut self, _height: u32) -> ErrorResult {
fn SetHeight(&mut self, _height: u32) -> ErrorResult {
Ok(())
}
}