diff options
author | Sam Gibson <sam@ifdown.net> | 2015-12-01 20:40:37 +1100 |
---|---|---|
committer | Sam Gibson <sam@ifdown.net> | 2015-12-03 14:00:53 +1100 |
commit | 2ba1750c403e59556f667b163d5d2a90dd5f6dd6 (patch) | |
tree | 0f766072a20256a909e31183b2a6870a7a31a291 /components/script/dom/macros.rs | |
parent | 419a26e6192a31478302c310910f1ae8f6f5e3ae (diff) | |
download | servo-2ba1750c403e59556f667b163d5d2a90dd5f6dd6.tar.gz servo-2ba1750c403e59556f667b163d5d2a90dd5f6dd6.zip |
Resolves long-running merge conflicts
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r-- | components/script/dom/macros.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs index a292737ac47..8029bb85b2f 100644 --- a/components/script/dom/macros.rs +++ b/components/script/dom/macros.rs @@ -28,21 +28,18 @@ macro_rules! make_bool_getter( #[macro_export] macro_rules! make_int_getter( - ($attr:ident, $htmlname:expr, $default:expr) => ( + ($attr:ident, $htmlname:tt, $default:expr) => ( fn $attr(&self) -> i32 { - use dom::bindings::codegen::InheritTypes::ElementCast; - use string_cache::Atom; - let element = ElementCast::from_ref(self); - // FIXME(pcwalton): Do this at compile time, not runtime. - element.get_int_attribute(&Atom::from_slice($htmlname), $default) + use dom::bindings::inheritance::Castable; + use dom::element::Element; + let element = self.upcast::<Element>(); + element.get_int_attribute(&atom!($htmlname), $default) } ); - ($attr:ident, $htmlname:expr) => { + + ($attr:ident, $htmlname:tt) => { make_int_getter!($attr, $htmlname, 0); }; - ($attr:ident) => { - make_int_getter!($attr, to_lower!(stringify!($attr))); - } ); #[macro_export] |