diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-11-25 06:49:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-25 06:49:44 -0800 |
commit | beec035eb0ff6babf48ce836184329e60e795177 (patch) | |
tree | eb068bd81c2a2ffe802398bb521d9ed2beadf21d /components/script/dom/validitystate.rs | |
parent | 67a4ecd68ec782fd661c0095df1e7f75e79a5d84 (diff) | |
parent | 2a408778518050d3632ad5c2694a96ae0b219cd9 (diff) | |
download | servo-beec035eb0ff6babf48ce836184329e60e795177.tar.gz servo-beec035eb0ff6babf48ce836184329e60e795177.zip |
Auto merge of #13969 - bbansalWolfPack:master, r=jdm
html form validation initial steps with test html file
<!-- Please describe your changes on the following line: -->
Added code for initial steps in html form validation.
1. Added methods for trait validatable
2. implemented stub methods for elements like HTMLInputElement, HTMLButtonElement, etc
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X ] `./mach build -d` does not report any errors
- [ X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13969)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/validitystate.rs')
-rwxr-xr-x[-rw-r--r--] | components/script/dom/validitystate.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/components/script/dom/validitystate.rs b/components/script/dom/validitystate.rs index c6bb0761f3c..10801120871 100644..100755 --- a/components/script/dom/validitystate.rs +++ b/components/script/dom/validitystate.rs @@ -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 { |