mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20: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, FormSubmitter, ResetFrom};
|
|||
use dom::htmlformelement::{SubmittedFrom, HTMLFormElement};
|
||||
use dom::node::{Node, UnbindContext, document_from_node, window_from_node};
|
||||
use dom::nodelist::NodeList;
|
||||
use dom::validation::Validatable;
|
||||
use dom::validitystate::ValidityState;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use std::ascii::AsciiExt;
|
||||
|
@ -66,7 +67,7 @@ impl HTMLButtonElementMethods for HTMLButtonElement {
|
|||
// 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())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-fe-disabled
|
||||
|
@ -203,6 +204,8 @@ impl VirtualMethods for HTMLButtonElement {
|
|||
|
||||
impl FormControl for HTMLButtonElement {}
|
||||
|
||||
impl Validatable for HTMLButtonElement {}
|
||||
|
||||
impl Activatable for HTMLButtonElement {
|
||||
fn as_element(&self) -> &Element {
|
||||
self.upcast()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue