mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +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
|
@ -232,7 +232,7 @@ impl<'a> HTMLInputElementHelpers for JSRef<'a, HTMLInputElement> {
|
|||
fn get_radio_group(self) -> Option<String> {
|
||||
//TODO: determine form owner
|
||||
let elem: JSRef<Element> = ElementCast::from_ref(self);
|
||||
elem.get_attribute(ns!(""), "name")
|
||||
elem.get_attribute(ns!(""), &atom!("name"))
|
||||
.root()
|
||||
.map(|name| name.Value())
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ impl<'a> FormOwner<'a> for JSRef<'a, HTMLInputElement> {
|
|||
fn form_owner(self) -> Option<Temporary<HTMLFormElement>> {
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#reset-the-form-owner
|
||||
let elem: JSRef<Element> = ElementCast::from_ref(self);
|
||||
let owner = elem.get_string_attribute("form");
|
||||
let owner = elem.get_string_attribute(&atom!("form"));
|
||||
if !owner.is_empty() {
|
||||
let doc = document_from_node(self).root();
|
||||
let owner = doc.GetElementById(owner).root();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue