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,28 +40,38 @@ impl HTMLProgressElement {
}
}
impl HTMLProgressElement {
pub fn Value(&self) -> f64 {
pub trait HTMLProgressElementMethods {
fn Value(&self) -> f64;
fn SetValue(&mut self, _value: f64) -> ErrorResult;
fn Max(&self) -> f64;
fn SetMax(&mut self, _max: f64) -> ErrorResult;
fn Position(&self) -> f64;
fn GetPositiom(&self) -> Fallible<f64>;
}
impl<'a> HTMLProgressElementMethods for JSRef<'a, HTMLProgressElement> {
fn Value(&self) -> f64 {
0f64
}
pub fn SetValue(&mut self, _value: f64) -> ErrorResult {
fn SetValue(&mut self, _value: f64) -> ErrorResult {
Ok(())
}
pub fn Max(&self) -> f64 {
fn Max(&self) -> f64 {
0f64
}
pub fn SetMax(&mut self, _max: f64) -> ErrorResult {
fn SetMax(&mut self, _max: f64) -> ErrorResult {
Ok(())
}
pub fn Position(&self) -> f64 {
fn Position(&self) -> f64 {
0f64
}
pub fn GetPositiom(&self) -> Fallible<f64> {
fn GetPositiom(&self) -> Fallible<f64> {
Ok(0f64)
}
}