mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +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
12
components/script/dom/htmlinputelement.rs
Normal file → Executable file
12
components/script/dom/htmlinputelement.rs
Normal file → Executable file
|
@ -31,6 +31,7 @@ use dom::node::{Node, NodeDamage, UnbindContext};
|
|||
use dom::node::{document_from_node, window_from_node};
|
||||
use dom::nodelist::NodeList;
|
||||
use dom::validation::Validatable;
|
||||
use dom::validitystate::ValidationFlags;
|
||||
use dom::virtualmethods::VirtualMethods;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use mime_guess;
|
||||
|
@ -1143,7 +1144,16 @@ impl VirtualMethods for HTMLInputElement {
|
|||
|
||||
impl FormControl for HTMLInputElement {}
|
||||
|
||||
impl Validatable for HTMLInputElement {}
|
||||
impl Validatable for HTMLInputElement {
|
||||
fn is_instance_validatable(&self) -> bool {
|
||||
// https://html.spec.whatwg.org/multipage/#candidate-for-constraint-validation
|
||||
true
|
||||
}
|
||||
fn validate(&self, _validate_flags: ValidationFlags) -> bool {
|
||||
// call stub methods defined in validityState.rs file here according to the flags set in validate_flags
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
impl Activatable for HTMLInputElement {
|
||||
fn as_element(&self) -> &Element {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue