mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +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
15
components/script/dom/validitystate.rs
Normal file → Executable file
15
components/script/dom/validitystate.rs
Normal file → Executable file
|
@ -26,6 +26,21 @@ pub enum ValidityStatus {
|
|||
Valid
|
||||
}
|
||||
|
||||
bitflags!{
|
||||
pub flags ValidationFlags: u32 {
|
||||
const VALUE_MISSING = 0b0000000001,
|
||||
const TYPE_MISMATCH = 0b0000000010,
|
||||
const PATTERN_MISMATCH = 0b0000000100,
|
||||
const TOO_LONG = 0b0000001000,
|
||||
const TOO_SHORT = 0b0000010000,
|
||||
const RANGE_UNDERFLOW = 0b0000100000,
|
||||
const RANGE_OVERFLOW = 0b0001000000,
|
||||
const STEP_MISMATCH = 0b0010000000,
|
||||
const BAD_INPUT = 0b0100000000,
|
||||
const CUSTOM_ERROR = 0b1000000000,
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#validitystate
|
||||
#[dom_struct]
|
||||
pub struct ValidityState {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue