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
d168501555
commit
ee2ccc4f87
31 changed files with 305 additions and 237 deletions
|
@ -62,7 +62,7 @@ impl<'a> HTMLButtonElementMethods for JSRef<'a, HTMLButtonElement> {
|
|||
// https://html.spec.whatwg.org/multipage/forms.html#dom-button-type
|
||||
fn Type(self) -> DOMString {
|
||||
let elem: JSRef<Element> = ElementCast::from_ref(self);
|
||||
let ty = elem.get_string_attribute("type").into_ascii_lower();
|
||||
let ty = elem.get_string_attribute(&atom!("type")).into_ascii_lower();
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#attr-button-type
|
||||
match ty.as_slice() {
|
||||
"reset" | "button" | "menu" => ty,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue