html form validation initial steps with test html file, added stub methods, added code to handle validations

This commit is contained in:
Bhavya Bansal 2016-10-28 18:12:20 -07:00
parent e4fcc066d1
commit 2a40877851
9 changed files with 124 additions and 15 deletions

13
components/script/dom/htmlbuttonelement.rs Normal file → Executable file
View 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 {