aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/macros.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-05-02 12:52:47 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-05-14 18:28:38 +0200
commit2176aab6425d3350bd9893fdb5bec6b53614a918 (patch)
tree1e168d5d6692b3613a7f7552c3498f1c7914b8e8 /components/script/dom/macros.rs
parent8979d77e77f58b2061d9cec81a08b7e6bf6c6e6a (diff)
downloadservo-2176aab6425d3350bd9893fdb5bec6b53614a918.tar.gz
servo-2176aab6425d3350bd9893fdb5bec6b53614a918.zip
Import string_cache::Atom into the attributes' macros
Diffstat (limited to 'components/script/dom/macros.rs')
-rw-r--r--components/script/dom/macros.rs21
1 files changed, 9 insertions, 12 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs
index d66190ffada..176feb927b9 100644
--- a/components/script/dom/macros.rs
+++ b/components/script/dom/macros.rs
@@ -8,8 +8,7 @@ macro_rules! make_getter(
fn $attr(self) -> DOMString {
use dom::element::{Element, AttributeHandlers};
use dom::bindings::codegen::InheritTypes::ElementCast;
- #[allow(unused_imports)]
- use std::ascii::AsciiExt;
+ use string_cache::Atom;
let element: JSRef<Element> = ElementCast::from_ref(self);
element.get_string_attribute(&Atom::from_slice($htmlname))
}
@@ -25,8 +24,7 @@ macro_rules! make_bool_getter(
fn $attr(self) -> bool {
use dom::element::{Element, AttributeHandlers};
use dom::bindings::codegen::InheritTypes::ElementCast;
- #[allow(unused_imports)]
- use std::ascii::AsciiExt;
+ use string_cache::Atom;
let element: JSRef<Element> = ElementCast::from_ref(self);
// FIXME(pcwalton): Do this at compile time, not runtime.
element.has_attribute(&Atom::from_slice($htmlname))
@@ -43,8 +41,7 @@ macro_rules! make_uint_getter(
fn $attr(self) -> u32 {
use dom::element::{Element, AttributeHandlers};
use dom::bindings::codegen::InheritTypes::ElementCast;
- #[allow(unused_imports)]
- use std::ascii::AsciiExt;
+ use string_cache::Atom;
let element: JSRef<Element> = ElementCast::from_ref(self);
// FIXME(pcwalton): Do this at compile time, not runtime.
element.get_uint_attribute(&Atom::from_slice($htmlname), $default)
@@ -64,8 +61,7 @@ macro_rules! make_url_getter(
fn $attr(self) -> DOMString {
use dom::element::{Element, AttributeHandlers};
use dom::bindings::codegen::InheritTypes::ElementCast;
- #[allow(unused_imports)]
- use std::ascii::AsciiExt;
+ use string_cache::Atom;
let element: JSRef<Element> = ElementCast::from_ref(self);
// FIXME(pcwalton): Do this at compile time, not runtime.
element.get_url_attribute(&Atom::from_slice($htmlname))
@@ -84,8 +80,7 @@ macro_rules! make_url_or_base_getter(
use dom::element::{Element, AttributeHandlers};
use dom::bindings::codegen::InheritTypes::ElementCast;
use dom::window::WindowHelpers;
- #[allow(unused_imports)]
- use std::ascii::AsciiExt;
+ use string_cache::Atom;
let element: JSRef<Element> = ElementCast::from_ref(self);
let url = element.get_url_attribute(&Atom::from_slice($htmlname));
if url.is_empty() {
@@ -107,8 +102,7 @@ macro_rules! make_enumerated_getter(
fn $attr(self) -> DOMString {
use dom::element::{Element, AttributeHandlers};
use dom::bindings::codegen::InheritTypes::ElementCast;
- #[allow(unused_imports)]
- use std::ascii::AsciiExt;
+ use string_cache::Atom;
use std::borrow::ToOwned;
let element: JSRef<Element> = ElementCast::from_ref(self);
let val = element.get_string_attribute(&Atom::from_slice($htmlname))
@@ -133,6 +127,7 @@ macro_rules! make_setter(
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_string_attribute(&Atom::from_slice($htmlname), value)
@@ -146,6 +141,7 @@ macro_rules! make_bool_setter(
fn $attr(self, value: bool) {
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_bool_attribute(&Atom::from_slice($htmlname), value)
@@ -159,6 +155,7 @@ macro_rules! make_uint_setter(
fn $attr(self, value: u32) {
use dom::element::{Element, AttributeHandlers};
use dom::bindings::codegen::InheritTypes::ElementCast;
+ use string_cache::Atom;
let value = if value > 2147483647 {
$default
} else {