script: Use atom comparison in more places, especially for attributes.

75% improvement in style recalc for Guardians of the Galaxy.
This commit is contained in:
Patrick Walton 2014-09-12 13:28:37 -07:00
parent 61642d64b5
commit 874db26104
32 changed files with 300 additions and 147 deletions

View file

@ -12,7 +12,8 @@ macro_rules! make_getter(
use dom::bindings::codegen::InheritTypes::ElementCast;
use std::ascii::StrAsciiExt;
let element: &JSRef<Element> = ElementCast::from_ref(self);
element.get_string_attribute(stringify!($attr).to_ascii_lower().as_slice())
element.get_string_attribute(&Atom::from_slice(stringify!($attr).to_ascii_lower()
.as_slice()))
}
);
)
@ -38,7 +39,8 @@ macro_rules! make_uint_getter(
use dom::bindings::codegen::InheritTypes::ElementCast;
use std::ascii::StrAsciiExt;
let element: &JSRef<Element> = ElementCast::from_ref(self);
element.get_uint_attribute(stringify!($attr).to_ascii_lower().as_slice())
element.get_uint_attribute(&Atom::from_slice(stringify!($attr).to_ascii_lower()
.as_slice()))
}
);
)