aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlappletelement.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-05-02 12:27:42 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-05-14 18:28:39 +0200
commitb86672af0c16d234150ac79297458f199c853825 (patch)
treedaaef697f759ca4401728363e710c989502c3161 /components/script/dom/htmlappletelement.rs
parent2176aab6425d3350bd9893fdb5bec6b53614a918 (diff)
downloadservo-b86672af0c16d234150ac79297458f199c853825.tar.gz
servo-b86672af0c16d234150ac79297458f199c853825.zip
Implement HTMLAppletElement.name
Diffstat (limited to 'components/script/dom/htmlappletelement.rs')
-rw-r--r--components/script/dom/htmlappletelement.rs27
1 files changed, 26 insertions, 1 deletions
diff --git a/components/script/dom/htmlappletelement.rs b/components/script/dom/htmlappletelement.rs
index 4ef0bc6cd2e..585df5d5273 100644
--- a/components/script/dom/htmlappletelement.rs
+++ b/components/script/dom/htmlappletelement.rs
@@ -3,13 +3,20 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::HTMLAppletElementBinding;
+use dom::bindings::codegen::Bindings::HTMLAppletElementBinding::HTMLAppletElementMethods;
+
+use dom::attr::AttrValue;
use dom::bindings::codegen::InheritTypes::HTMLAppletElementDerived;
+use dom::bindings::codegen::InheritTypes::HTMLElementCast;
use dom::bindings::js::{JSRef, Temporary};
use dom::document::Document;
-use dom::element::ElementTypeId;
+use dom::element::{AttributeHandlers, ElementTypeId};
use dom::eventtarget::{EventTarget, EventTargetTypeId};
use dom::htmlelement::{HTMLElement, HTMLElementTypeId};
use dom::node::{Node, NodeTypeId};
+use dom::virtualmethods::VirtualMethods;
+
+use string_cache::Atom;
use util::str::DOMString;
#[dom_struct]
@@ -37,3 +44,21 @@ impl HTMLAppletElement {
}
}
+impl<'a> HTMLAppletElementMethods for JSRef<'a, HTMLAppletElement> {
+ // https://html.spec.whatwg.org/#the-applet-element:dom-applet-name
+ make_getter!(Name);
+ make_atomic_setter!(SetName, "name");
+}
+
+impl<'a> VirtualMethods for JSRef<'a, HTMLAppletElement> {
+ fn super_type<'b>(&'b self) -> Option<&'b VirtualMethods> {
+ Some(HTMLElementCast::from_borrowed_ref(self) as &VirtualMethods)
+ }
+
+ fn parse_plain_attribute(&self, name: &Atom, value: DOMString) -> AttrValue {
+ match name {
+ &atom!("name") => AttrValue::from_atomic(value),
+ _ => self.super_type().unwrap().parse_plain_attribute(name, value),
+ }
+ }
+}