mirror of
https://github.com/servo/servo.git
synced 2025-07-26 16:50:23 +01:00
Implement initial pieces of form validation.
This commit is contained in:
parent
7a9dc57761
commit
051ffba0e5
14 changed files with 185 additions and 55 deletions
|
@ -18,6 +18,7 @@ use dom::htmlformelement::{FormControl, FormDatum, HTMLFormElement};
|
|||
use dom::htmloptionelement::HTMLOptionElement;
|
||||
use dom::node::{Node, UnbindContext, window_from_node};
|
||||
use dom::nodelist::NodeList;
|
||||
use dom::validation::Validatable;
|
||||
use dom::validitystate::ValidityState;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use string_cache::Atom;
|
||||
|
@ -130,7 +131,7 @@ impl HTMLSelectElementMethods for HTMLSelectElement {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-cva-validity
|
||||
fn Validity(&self) -> Root<ValidityState> {
|
||||
let window = window_from_node(self);
|
||||
ValidityState::new(window.r())
|
||||
ValidityState::new(window.r(), self.upcast())
|
||||
}
|
||||
|
||||
// Note: this function currently only exists for union.html.
|
||||
|
@ -234,3 +235,5 @@ impl VirtualMethods for HTMLSelectElement {
|
|||
}
|
||||
|
||||
impl FormControl for HTMLSelectElement {}
|
||||
|
||||
impl Validatable for HTMLSelectElement {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue