mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
61642d64b5
commit
874db26104
32 changed files with 300 additions and 147 deletions
|
@ -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()))
|
||||
}
|
||||
);
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue