mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +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
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue