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 -->
This commit is contained in:
bors-servo 2016-11-25 06:49:44 -08:00 committed by GitHub
commit beec035eb0
9 changed files with 124 additions and 15 deletions

13
components/script/dom/htmlobjectelement.rs Normal file → Executable file
View file

@ -15,7 +15,7 @@ use dom::htmlelement::HTMLElement;
use dom::htmlformelement::{FormControl, HTMLFormElement};
use dom::node::{Node, window_from_node};
use dom::validation::Validatable;
use dom::validitystate::ValidityState;
use dom::validitystate::{ValidityState, ValidationFlags};
use dom::virtualmethods::VirtualMethods;
use html5ever_atoms::LocalName;
use net_traits::image::base::Image;
@ -89,7 +89,16 @@ impl HTMLObjectElementMethods for HTMLObjectElement {
}
}
impl Validatable for HTMLObjectElement {}
impl Validatable for HTMLObjectElement {
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 VirtualMethods for HTMLObjectElement {
fn super_type(&self) -> Option<&VirtualMethods> {