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/htmlselectelement.rs Normal file → Executable file
View file

@ -28,7 +28,7 @@ use dom::htmloptionscollection::HTMLOptionsCollection;
use dom::node::{Node, UnbindContext, 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 string_cache::Atom;
use style::attr::AttrValue;
@ -384,4 +384,13 @@ impl VirtualMethods for HTMLSelectElement {
impl FormControl for HTMLSelectElement {}
impl Validatable for HTMLSelectElement {}
impl Validatable for HTMLSelectElement {
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
}
}