aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlobjectelement.rs
diff options
context:
space:
mode:
authorSagar Muchhal <muchhalsagar88@gmail.com>2016-03-18 19:53:34 -0400
committerJosh Matthews <josh@joshmatthews.net>2016-03-24 09:07:38 -0400
commit051ffba0e5dd22b779a059be164a9748e305496c (patch)
treefa23afb077ba83a415d4cd083d129868694874f8 /components/script/dom/htmlobjectelement.rs
parent7a9dc577617b442ff0fe07eaa683207234c519ee (diff)
downloadservo-051ffba0e5dd22b779a059be164a9748e305496c.tar.gz
servo-051ffba0e5dd22b779a059be164a9748e305496c.zip
Implement initial pieces of form validation.
Diffstat (limited to 'components/script/dom/htmlobjectelement.rs')
-rw-r--r--components/script/dom/htmlobjectelement.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs
index c60c4dd1d13..4d2b1cde778 100644
--- a/components/script/dom/htmlobjectelement.rs
+++ b/components/script/dom/htmlobjectelement.rs
@@ -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)