aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/macros.rs
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2015-11-24 13:44:59 -0600
committerAlan Jeffrey <ajeffrey@mozilla.com>2015-11-25 10:13:21 -0600
commit3dec6edd10ec800de50a04c105a75fb98e0411ca (patch)
tree9ef42584eb3b543904524248ad11c1dff84082a5 /components/script/dom/macros.rs
parente7b19249489eff7a7fd49bf458ee7bd681f8ad13 (diff)
downloadservo-3dec6edd10ec800de50a04c105a75fb98e0411ca.tar.gz
servo-3dec6edd10ec800de50a04c105a75fb98e0411ca.zip
Update string_cache to 0.2.
Updated string_cache, html5ever, xml5ever and selectors in Cargo.toml files and Cargo.lock. Removed references to string_cache_plugin. Import atom! and ns! from string_cache. Replaced ns!("") by ns!(). Replaced ns!(XML) and co by ns!(xml) and co. Replaced atom!(foo) by atom!("foo"). Replaced Atom::from_slice by Atom::from. Replaced atom.as_slice() by &*atom.
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r--components/script/dom/macros.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index 4cdd6eb277e..cdfeebc01cb 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -10,7 +10,7 @@ macro_rules! make_getter(
use dom::element::Element;
use string_cache::Atom;
let element = self.upcast::<Element>();
- element.get_string_attribute(&Atom::from_slice($htmlname))
+ element.get_string_attribute(&Atom::from($htmlname))
}
);
($attr:ident) => {
@@ -27,7 +27,7 @@ macro_rules! make_bool_getter(
use string_cache::Atom;
let element = self.upcast::<Element>();
// FIXME(pcwalton): Do this at compile time, not runtime.
- element.has_attribute(&Atom::from_slice($htmlname))
+ element.has_attribute(&Atom::from($htmlname))
}
);
($attr:ident) => {
@@ -44,7 +44,7 @@ macro_rules! make_uint_getter(
use string_cache::Atom;
let element = self.upcast::<Element>();
// FIXME(pcwalton): Do this at compile time, not runtime.
- element.get_uint_attribute(&Atom::from_slice($htmlname), $default)
+ element.get_uint_attribute(&Atom::from($htmlname), $default)
}
);
($attr:ident, $htmlname:expr) => {
@@ -64,7 +64,7 @@ macro_rules! make_url_getter(
use string_cache::Atom;
let element = self.upcast::<Element>();
// FIXME(pcwalton): Do this at compile time, not runtime.
- element.get_url_attribute(&Atom::from_slice($htmlname))
+ element.get_url_attribute(&Atom::from($htmlname))
}
);
($attr:ident) => {
@@ -81,7 +81,7 @@ macro_rules! make_url_or_base_getter(
use dom::element::Element;
use string_cache::Atom;
let element = self.upcast::<Element>();
- let url = element.get_url_attribute(&Atom::from_slice($htmlname));
+ let url = element.get_url_attribute(&Atom::from($htmlname));
if url.is_empty() {
let window = window_from_node(self);
DOMString::from(window.get_url().serialize())
@@ -104,7 +104,7 @@ macro_rules! make_enumerated_getter(
use std::ascii::AsciiExt;
use string_cache::Atom;
let element = self.upcast::<Element>();
- let mut val = element.get_string_attribute(&Atom::from_slice($htmlname));
+ let mut val = element.get_string_attribute(&Atom::from(*$htmlname));
val.make_ascii_lowercase();
// https://html.spec.whatwg.org/multipage/#attr-fs-method
match &*val {
@@ -129,7 +129,7 @@ macro_rules! make_setter(
use string_cache::Atom;
let element = self.upcast::<Element>();
// FIXME(pcwalton): Do this at compile time, not at runtime.
- element.set_string_attribute(&Atom::from_slice($htmlname), value)
+ element.set_string_attribute(&Atom::from($htmlname), value)
}
);
);
@@ -143,7 +143,7 @@ macro_rules! make_bool_setter(
use string_cache::Atom;
let element = self.upcast::<Element>();
// FIXME(pcwalton): Do this at compile time, not at runtime.
- element.set_bool_attribute(&Atom::from_slice($htmlname), value)
+ element.set_bool_attribute(&Atom::from($htmlname), value)
}
);
);
@@ -163,7 +163,7 @@ macro_rules! make_uint_setter(
};
let element = self.upcast::<Element>();
// FIXME(pcwalton): Do this at compile time, not at runtime.
- element.set_uint_attribute(&Atom::from_slice($htmlname), value)
+ element.set_uint_attribute(&Atom::from($htmlname), value)
}
);
($attr:ident, $htmlname:expr) => {
@@ -188,7 +188,7 @@ macro_rules! make_limited_uint_setter(
};
let element = self.upcast::<Element>();
// FIXME(pcwalton): Do this at compile time, not runtime.
- element.set_uint_attribute(&Atom::from_slice($htmlname), value);
+ element.set_uint_attribute(&Atom::from($htmlname), value);
Ok(())
}
);
@@ -209,7 +209,7 @@ macro_rules! make_atomic_setter(
use string_cache::Atom;
let element = self.upcast::<Element>();
// FIXME(pcwalton): Do this at compile time, not at runtime.
- element.set_atomic_attribute(&Atom::from_slice($htmlname), value)
+ element.set_atomic_attribute(&Atom::from($htmlname), value)
}
);
);
@@ -225,7 +225,7 @@ macro_rules! make_legacy_color_setter(
let element = self.upcast::<Element>();
let value = AttrValue::from_legacy_color(value);
// FIXME(pcwalton): Do this at compile time, not at runtime.
- element.set_attribute(&Atom::from_slice($htmlname), value)
+ element.set_attribute(&Atom::from($htmlname), value)
}
);
);
@@ -240,7 +240,7 @@ macro_rules! make_dimension_setter(
let element = self.upcast::<Element>();
let value = AttrValue::from_dimension(value);
// FIXME(pcwalton): Do this at compile time, not at runtime.
- element.set_attribute(&Atom::from_slice($htmlname), value)
+ element.set_attribute(&Atom::from($htmlname), value)
}
);
);