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

@ -75,7 +75,7 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> {
fn get_url(&self) -> Option<Url> {
let element: &JSRef<Element> = ElementCast::from_ref(self);
element.get_attribute(Null, "src").root().and_then(|src| {
element.get_attribute(Null, &satom!("src")).root().and_then(|src| {
let url = src.deref().value();
if url.as_slice().is_empty() {
None
@ -133,7 +133,7 @@ impl HTMLIFrameElement {
impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> {
fn Src(&self) -> DOMString {
let element: &JSRef<Element> = ElementCast::from_ref(self);
element.get_string_attribute("src")
element.get_string_attribute(&satom!("src"))
}
fn SetSrc(&self, src: DOMString) {
@ -143,7 +143,7 @@ impl<'a> HTMLIFrameElementMethods for JSRef<'a, HTMLIFrameElement> {
fn Sandbox(&self) -> DOMString {
let element: &JSRef<Element> = ElementCast::from_ref(self);
element.get_string_attribute("sandbox")
element.get_string_attribute(&satom!("sandbox"))
}
fn SetSandbox(&self, sandbox: DOMString) {