mirror of
https://github.com/servo/servo.git
synced 2025-06-13 02:44:29 +00:00
Implement initial pieces of form validation.
This commit is contained in:
parent
7a9dc57761
commit
051ffba0e5
14 changed files with 185 additions and 55 deletions
|
@ -13,6 +13,7 @@ use dom::element::{AttributeMutation, Element};
|
|||
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::virtualmethods::VirtualMethods;
|
||||
use net_traits::image::base::Image;
|
||||
|
@ -76,7 +77,7 @@ impl HTMLObjectElementMethods for HTMLObjectElement {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-cva-validity
|
||||
fn Validity(&self) -> Root<ValidityState> {
|
||||
let window = window_from_node(self);
|
||||
ValidityState::new(window.r())
|
||||
ValidityState::new(window.r(), self.upcast())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-object-type
|
||||
|
@ -91,6 +92,8 @@ impl HTMLObjectElementMethods for HTMLObjectElement {
|
|||
}
|
||||
}
|
||||
|
||||
impl Validatable for HTMLObjectElement {}
|
||||
|
||||
impl VirtualMethods for HTMLObjectElement {
|
||||
fn super_type(&self) -> Option<&VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &VirtualMethods)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue