mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
webdriver: Implement element clear (#38208)
Initial Implementation of [Element Clear](https://w3c.github.io/webdriver/#element-clear). Testing: `tests/wpt/tests/webdriver/tests/classic/element_clear/` --------- Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com> Signed-off-by: Kenzie Raditya Tirtarahardja <kenzieradityatirtarahardja18@gmail.com> Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
1fb782bc38
commit
4b12ae73fe
11 changed files with 175 additions and 367 deletions
|
@ -1698,8 +1698,18 @@ pub(crate) trait FormControl: DomObject {
|
|||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#candidate-for-constraint-validation>
|
||||
fn is_candidate_for_constraint_validation(&self) -> bool {
|
||||
let element = self.to_element();
|
||||
let html_element = element.downcast::<HTMLElement>();
|
||||
if let Some(html_element) = html_element {
|
||||
html_element.is_submittable_element() || element.is_instance_validatable()
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
// XXXKiChjang: Implement these on inheritors
|
||||
// fn candidate_for_validation(&self) -> bool;
|
||||
// fn satisfies_constraints(&self) -> bool;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue