servo: Merge #3316 - script: Use atom comparison in more places, especially for attributes (from pcwalton:use-atoms)

Source-Repo: https://github.com/servo/servo
Source-Revision: 787a68336524fb9585922b9ed319a8b194fb8ee1
This commit is contained in:
Patrick Walton
2014-09-17 13:19:00 -07:00
parent 00bd2f8916
commit 3834566a2b
32 changed files with 300 additions and 147 deletions

View File

@@ -57,6 +57,7 @@ use script::dom::node::{CommentNodeTypeId, DoctypeNodeTypeId, DocumentFragmentNo
use script::dom::node::{DocumentNodeTypeId, ElementNodeTypeId, ProcessingInstructionNodeTypeId};
use script::dom::node::{TextNodeTypeId};
use script::dom::htmlobjectelement::is_image_data;
use servo_util::atom::Atom;
use servo_util::namespace;
use std::mem;
use std::sync::atomics::Relaxed;
@@ -1047,7 +1048,8 @@ trait ObjectElement {
impl<'ln> ObjectElement for ThreadSafeLayoutNode<'ln> {
fn get_type_and_data(&self) -> (Option<&'static str>, Option<&'static str>) {
let elem = self.as_element();
(elem.get_attr(&namespace::Null, "type"), elem.get_attr(&namespace::Null, "data"))
(elem.get_attr(&namespace::Null, &satom!("type")),
elem.get_attr(&namespace::Null, &satom!("data")))
}
fn has_object_data(&self) -> bool {