aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/macros.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/macros.rs
parent2176aab6425d3350bd9893fdb5bec6b53614a918 (diff)
downloadservo-b86672af0c16d234150ac79297458f199c853825.tar.gz
servo-b86672af0c16d234150ac79297458f199c853825.zip
Implement HTMLAppletElement.name
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r--components/script/dom/macros.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index 176feb927b9..97a8e7a74d7 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -199,6 +199,20 @@ macro_rules! make_limited_uint_setter(
};
);
+#[macro_export]
+macro_rules! make_atomic_setter(
+ ( $attr:ident, $htmlname:expr ) => (
+ fn $attr(self, value: DOMString) {
+ use dom::element::{Element, AttributeHandlers};
+ use dom::bindings::codegen::InheritTypes::ElementCast;
+ use string_cache::Atom;
+ let element: JSRef<Element> = ElementCast::from_ref(self);
+ // FIXME(pcwalton): Do this at compile time, not at runtime.
+ element.set_atomic_attribute(&Atom::from_slice($htmlname), value)
+ }
+ );
+);
+
/// For use on non-jsmanaged types
/// Use #[jstraceable] on JS managed types
macro_rules! no_jsmanaged_fields(