mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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
|
@ -30,44 +30,57 @@ impl ValidityState {
|
|||
}
|
||||
}
|
||||
|
||||
impl ValidityState {
|
||||
pub fn ValueMissing(&self) -> bool {
|
||||
pub trait ValidityStateMethods {
|
||||
fn ValueMissing(&self) -> bool;
|
||||
fn TypeMismatch(&self) -> bool;
|
||||
fn PatternMismatch(&self) -> bool;
|
||||
fn TooLong(&self) -> bool;
|
||||
fn RangeUnderflow(&self) -> bool;
|
||||
fn RangeOverflow(&self) -> bool;
|
||||
fn StepMismatch(&self) -> bool;
|
||||
fn CustomError(&self) -> bool;
|
||||
fn Valid(&self) -> bool;
|
||||
}
|
||||
|
||||
impl<'a> ValidityStateMethods for JSRef<'a, ValidityState> {
|
||||
fn ValueMissing(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn TypeMismatch(&self) -> bool {
|
||||
fn TypeMismatch(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn PatternMismatch(&self) -> bool {
|
||||
fn PatternMismatch(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn TooLong(&self) -> bool {
|
||||
fn TooLong(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn RangeUnderflow(&self) -> bool {
|
||||
fn RangeUnderflow(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn RangeOverflow(&self) -> bool {
|
||||
fn RangeOverflow(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn StepMismatch(&self) -> bool {
|
||||
fn StepMismatch(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn CustomError(&self) -> bool {
|
||||
fn CustomError(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
pub fn Valid(&self) -> bool {
|
||||
fn Valid(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
impl Reflectable for ValidityState {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
&self.reflector_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue