mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
html form validation initial steps with test html file, added stub methods, added code to handle validations
This commit is contained in:
parent
e4fcc066d1
commit
2a40877851
9 changed files with 124 additions and 15 deletions
13
components/script/dom/htmlbuttonelement.rs
Normal file → Executable file
13
components/script/dom/htmlbuttonelement.rs
Normal file → Executable file
|
@ -21,7 +21,7 @@ use dom::htmlformelement::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::validitystate::{ValidityState, ValidationFlags};
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use std::cell::Cell;
|
||||
use string_cache::Atom;
|
||||
|
@ -238,7 +238,16 @@ impl VirtualMethods for HTMLButtonElement {
|
|||
|
||||
impl FormControl for HTMLButtonElement {}
|
||||
|
||||
impl Validatable for HTMLButtonElement {}
|
||||
impl Validatable for HTMLButtonElement {
|
||||
fn is_instance_validatable(&self) -> bool {
|
||||
true
|
||||
}
|
||||
fn validate(&self, validate_flags: ValidationFlags) -> bool {
|
||||
if validate_flags.is_empty() {}
|
||||
// Need more flag check for different validation types later
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
impl Activatable for HTMLButtonElement {
|
||||
fn as_element(&self) -> &Element {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue