diff options
author | vrod <rodrigues.victor.vsr@gmail.com> | 2016-07-26 22:40:19 -0300 |
---|---|---|
committer | vrod <rodrigues.victor.vsr@gmail.com> | 2016-07-28 21:07:21 -0300 |
commit | defaa5bee70fd1d5301b857b20d78bdfd3cb0b4d (patch) | |
tree | a6ae80d339be186f5bcb55f0cce9dc5bf6bc7a10 /components/script/dom/macros.rs | |
parent | 1f34d4f219a8d237acbf02737343ce520d73fd7a (diff) | |
download | servo-defaa5bee70fd1d5301b857b20d78bdfd3cb0b4d.tar.gz servo-defaa5bee70fd1d5301b857b20d78bdfd3cb0b4d.zip |
Implement HTMLLIElement#value
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r-- | components/script/dom/macros.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs index 58af2b28ac6..2b29ec8014c 100644 --- a/components/script/dom/macros.rs +++ b/components/script/dom/macros.rs @@ -47,6 +47,22 @@ macro_rules! make_limited_int_setter( ); #[macro_export] +macro_rules! make_int_setter( + ($attr:ident, $htmlname:tt, $default:expr) => ( + fn $attr(&self, value: i32) { + use dom::bindings::inheritance::Castable; + use dom::element::Element; + + let element = self.upcast::<Element>(); + element.set_int_attribute(&atom!($htmlname), value) + } + ); + ($attr:ident, $htmlname:tt) => { + make_int_setter!($attr, $htmlname, 0); + }; +); + +#[macro_export] macro_rules! make_int_getter( ($attr:ident, $htmlname:tt, $default:expr) => ( fn $attr(&self) -> i32 { |