aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlobjectelement.rs
diff options
context:
space:
mode:
authorPhilipp Hartwig <ph@phhart.de>2015-09-27 19:08:53 +0200
committerPhilipp Hartwig <ph@phhart.de>2015-09-27 19:08:53 +0200
commit8d67914c7f33364435171c400698db998875595f (patch)
treec46d65cd9fab98a3e5c132f22588c14ef9aae428 /components/script/dom/htmlobjectelement.rs
parenta1fb8cfbb0be8d0a73bc1e3b63eb704f48098b8f (diff)
downloadservo-8d67914c7f33364435171c400698db998875595f.tar.gz
servo-8d67914c7f33364435171c400698db998875595f.zip
Add form getters for additional elements; update test expectations
This adds form getters for fieldset, label, object, output, select and textarea elements.
Diffstat (limited to 'components/script/dom/htmlobjectelement.rs')
-rw-r--r--components/script/dom/htmlobjectelement.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs
index ac063d12f00..e197f1d60c4 100644
--- a/components/script/dom/htmlobjectelement.rs
+++ b/components/script/dom/htmlobjectelement.rs
@@ -10,9 +10,10 @@ use dom::bindings::codegen::InheritTypes::HTMLObjectElementDerived;
use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast};
use dom::bindings::js::Root;
use dom::document::Document;
-use dom::element::{AttributeMutation, ElementTypeId};
+use dom::element::{AttributeMutation, Element, ElementTypeId};
use dom::eventtarget::{EventTarget, EventTargetTypeId};
use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
+use dom::htmlformelement::{FormControl, HTMLFormElement};
use dom::node::{Node, NodeTypeId, window_from_node};
use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods;
@@ -92,6 +93,11 @@ impl HTMLObjectElementMethods for HTMLObjectElement {
// https://html.spec.whatwg.org/multipage/#dom-object-type
make_setter!(SetType, "type");
+
+ // https://html.spec.whatwg.org/multipage#dom-fae-form
+ fn GetForm(&self) -> Option<Root<HTMLFormElement>> {
+ self.form_owner()
+ }
}
impl VirtualMethods for HTMLObjectElement {
@@ -112,3 +118,9 @@ impl VirtualMethods for HTMLObjectElement {
}
}
}
+
+impl<'a> FormControl<'a> for &'a HTMLObjectElement {
+ fn to_element(self) -> &'a Element {
+ ElementCast::from_ref(self)
+ }
+}