servo: Merge #8786 - Remove unnecessary conversion to/from DOMString for localName (from eefriedman:localname-atom); r=jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: 63762d2b52ee6026216d304c8826bf8b4a5fdd20
This commit is contained in:
Eli Friedman 2015-12-03 14:36:22 +05:01
Родитель de8f872ba4
Коммит 70ebd13eff
72 изменённых файлов: 202 добавлений и 153 удалений

Просмотреть файл

@ -87,16 +87,16 @@ pub fn create_element(name: QualName,
let prefix = prefix.map(|p| DOMString::from(&*p)); let prefix = prefix.map(|p| DOMString::from(&*p));
if name.ns != ns!(html) { if name.ns != ns!(html) {
return Element::new(DOMString::from(&*name.local), name.ns, prefix, document); return Element::new(name.local, name.ns, prefix, document);
} }
macro_rules! make( macro_rules! make(
($ctor:ident) => ({ ($ctor:ident) => ({
let obj = $ctor::new(DOMString::from(&*name.local), prefix, document); let obj = $ctor::new(name.local, prefix, document);
Root::upcast(obj) Root::upcast(obj)
}); });
($ctor:ident, $($arg:expr),+) => ({ ($ctor:ident, $($arg:expr),+) => ({
let obj = $ctor::new(DOMString::from(&*name.local), prefix, document, $($arg),+); let obj = $ctor::new(name.local, prefix, document, $($arg),+);
Root::upcast(obj) Root::upcast(obj)
}) })
); );

Просмотреть файл

@ -132,14 +132,14 @@ impl DOMImplementationMethods for DOMImplementation {
{ {
// Step 4. // Step 4.
let doc_node = doc.upcast::<Node>(); let doc_node = doc.upcast::<Node>();
let doc_html = Root::upcast::<Node>(HTMLHtmlElement::new(DOMString::from("html"), let doc_html = Root::upcast::<Node>(HTMLHtmlElement::new(atom!("html"),
None, None,
doc.r())); doc.r()));
doc_node.AppendChild(&doc_html).expect("Appending failed"); doc_node.AppendChild(&doc_html).expect("Appending failed");
{ {
// Step 5. // Step 5.
let doc_head = Root::upcast::<Node>(HTMLHeadElement::new(DOMString::from("head"), let doc_head = Root::upcast::<Node>(HTMLHeadElement::new(atom!("head"),
None, None,
doc.r())); doc.r()));
doc_html.AppendChild(&doc_head).unwrap(); doc_html.AppendChild(&doc_head).unwrap();
@ -150,7 +150,7 @@ impl DOMImplementationMethods for DOMImplementation {
Some(title_str) => { Some(title_str) => {
// Step 6.1. // Step 6.1.
let doc_title = let doc_title =
Root::upcast::<Node>(HTMLTitleElement::new(DOMString::from("title"), Root::upcast::<Node>(HTMLTitleElement::new(atom!("title"),
None, None,
doc.r())); doc.r()));
doc_head.AppendChild(&doc_title).unwrap(); doc_head.AppendChild(&doc_title).unwrap();
@ -163,7 +163,7 @@ impl DOMImplementationMethods for DOMImplementation {
} }
// Step 7. // Step 7.
let doc_body = HTMLBodyElement::new(DOMString::from("body"), None, doc.r()); let doc_body = HTMLBodyElement::new(atom!("body"), None, doc.r());
doc_html.AppendChild(doc_body.upcast()).unwrap(); doc_html.AppendChild(doc_body.upcast()).unwrap();
} }

Просмотреть файл

@ -126,20 +126,20 @@ impl Element {
} }
pub fn new_inherited(local_name: DOMString, pub fn new_inherited(local_name: Atom,
namespace: Namespace, prefix: Option<DOMString>, namespace: Namespace, prefix: Option<DOMString>,
document: &Document) -> Element { document: &Document) -> Element {
Element::new_inherited_with_state(ElementState::empty(), local_name, Element::new_inherited_with_state(ElementState::empty(), local_name,
namespace, prefix, document) namespace, prefix, document)
} }
pub fn new_inherited_with_state(state: ElementState, local_name: DOMString, pub fn new_inherited_with_state(state: ElementState, local_name: Atom,
namespace: Namespace, prefix: Option<DOMString>, namespace: Namespace, prefix: Option<DOMString>,
document: &Document) document: &Document)
-> Element { -> Element {
Element { Element {
node: Node::new_inherited(document), node: Node::new_inherited(document),
local_name: Atom::from(&*local_name), local_name: local_name,
namespace: namespace, namespace: namespace,
prefix: prefix, prefix: prefix,
attrs: DOMRefCell::new(vec![]), attrs: DOMRefCell::new(vec![]),
@ -151,7 +151,7 @@ impl Element {
} }
} }
pub fn new(local_name: DOMString, pub fn new(local_name: Atom,
namespace: Namespace, namespace: Namespace,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<Element> { document: &Document) -> Root<Element> {

Просмотреть файл

@ -35,7 +35,7 @@ pub struct HTMLAnchorElement {
} }
impl HTMLAnchorElement { impl HTMLAnchorElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLAnchorElement { document: &Document) -> HTMLAnchorElement {
HTMLAnchorElement { HTMLAnchorElement {
@ -46,7 +46,7 @@ impl HTMLAnchorElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAnchorElement> { document: &Document) -> Root<HTMLAnchorElement> {
let element = HTMLAnchorElement::new_inherited(localName, prefix, document); let element = HTMLAnchorElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -20,7 +20,7 @@ pub struct HTMLAppletElement {
} }
impl HTMLAppletElement { impl HTMLAppletElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLAppletElement { document: &Document) -> HTMLAppletElement {
HTMLAppletElement { HTMLAppletElement {
@ -30,7 +30,7 @@ impl HTMLAppletElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAppletElement> { document: &Document) -> Root<HTMLAppletElement> {
let element = HTMLAppletElement::new_inherited(localName, prefix, document); let element = HTMLAppletElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -24,7 +24,7 @@ pub struct HTMLAreaElement {
} }
impl HTMLAreaElement { impl HTMLAreaElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLAreaElement {
HTMLAreaElement { HTMLAreaElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(localName, prefix, document),
rel_list: Default::default(), rel_list: Default::default(),
@ -32,7 +32,7 @@ impl HTMLAreaElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAreaElement> { document: &Document) -> Root<HTMLAreaElement> {
let element = HTMLAreaElement::new_inherited(localName, prefix, document); let element = HTMLAreaElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlmediaelement::HTMLMediaElement; use dom::htmlmediaelement::HTMLMediaElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLAudioElement {
} }
impl HTMLAudioElement { impl HTMLAudioElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLAudioElement { document: &Document) -> HTMLAudioElement {
HTMLAudioElement { HTMLAudioElement {
@ -25,7 +26,7 @@ impl HTMLAudioElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLAudioElement> { document: &Document) -> Root<HTMLAudioElement> {
let element = HTMLAudioElement::new_inherited(localName, prefix, document); let element = HTMLAudioElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -11,6 +11,7 @@ use dom::element::{AttributeMutation, Element};
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{Node, document_from_node}; use dom::node::{Node, document_from_node};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use url::{Url, UrlParser}; use url::{Url, UrlParser};
use util::str::DOMString; use util::str::DOMString;
@ -20,14 +21,14 @@ pub struct HTMLBaseElement {
} }
impl HTMLBaseElement { impl HTMLBaseElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBaseElement {
HTMLBaseElement { HTMLBaseElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLBaseElement> { document: &Document) -> Root<HTMLBaseElement> {
let element = HTMLBaseElement::new_inherited(localName, prefix, document); let element = HTMLBaseElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -36,7 +36,7 @@ pub struct HTMLBodyElement {
} }
impl HTMLBodyElement { impl HTMLBodyElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLBodyElement { -> HTMLBodyElement {
HTMLBodyElement { HTMLBodyElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(localName, prefix, document),
@ -45,7 +45,7 @@ impl HTMLBodyElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, prefix: Option<DOMString>, document: &Document) pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLBodyElement> { -> Root<HTMLBodyElement> {
let element = HTMLBodyElement::new_inherited(localName, prefix, document); let element = HTMLBodyElement::new_inherited(localName, prefix, document);
Node::reflect_node(box element, document, HTMLBodyElementBinding::Wrap) Node::reflect_node(box element, document, HTMLBodyElementBinding::Wrap)

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,14 +16,14 @@ pub struct HTMLBRElement {
} }
impl HTMLBRElement { impl HTMLBRElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLBRElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLBRElement {
HTMLBRElement { HTMLBRElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLBRElement> { document: &Document) -> Root<HTMLBRElement> {
let element = HTMLBRElement::new_inherited(localName, prefix, document); let element = HTMLBRElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -23,6 +23,7 @@ use dom::virtualmethods::VirtualMethods;
use selectors::states::*; use selectors::states::*;
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
use std::cell::Cell; use std::cell::Cell;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[derive(JSTraceable, PartialEq, Copy, Clone)] #[derive(JSTraceable, PartialEq, Copy, Clone)]
@ -42,7 +43,7 @@ pub struct HTMLButtonElement {
} }
impl HTMLButtonElement { impl HTMLButtonElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLButtonElement { document: &Document) -> HTMLButtonElement {
HTMLButtonElement { HTMLButtonElement {
@ -55,7 +56,7 @@ impl HTMLButtonElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLButtonElement> { document: &Document) -> Root<HTMLButtonElement> {
let element = HTMLButtonElement::new_inherited(localName, prefix, document); let element = HTMLButtonElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -60,7 +60,7 @@ impl PartialEq for HTMLCanvasElement {
} }
impl HTMLCanvasElement { impl HTMLCanvasElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLCanvasElement { document: &Document) -> HTMLCanvasElement {
HTMLCanvasElement { HTMLCanvasElement {
@ -70,7 +70,7 @@ impl HTMLCanvasElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLCanvasElement> { document: &Document) -> Root<HTMLCanvasElement> {
let element = HTMLCanvasElement::new_inherited(localName, prefix, document); let element = HTMLCanvasElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLDataElement {
} }
impl HTMLDataElement { impl HTMLDataElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDataElement { document: &Document) -> HTMLDataElement {
HTMLDataElement { HTMLDataElement {
@ -24,7 +25,7 @@ impl HTMLDataElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDataElement> { document: &Document) -> Root<HTMLDataElement> {
let element = HTMLDataElement::new_inherited(localName, prefix, document); let element = HTMLDataElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -12,6 +12,7 @@ use dom::htmlcollection::{CollectionFilter, HTMLCollection};
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::htmloptionelement::HTMLOptionElement; use dom::htmloptionelement::HTMLOptionElement;
use dom::node::{Node, window_from_node}; use dom::node::{Node, window_from_node};
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -20,7 +21,7 @@ pub struct HTMLDataListElement {
} }
impl HTMLDataListElement { impl HTMLDataListElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDataListElement { document: &Document) -> HTMLDataListElement {
HTMLDataListElement { HTMLDataListElement {
@ -30,7 +31,7 @@ impl HTMLDataListElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDataListElement> { document: &Document) -> Root<HTMLDataListElement> {
let element = HTMLDataListElement::new_inherited(localName, prefix, document); let element = HTMLDataListElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -9,6 +9,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -18,7 +19,7 @@ pub struct HTMLDialogElement {
} }
impl HTMLDialogElement { impl HTMLDialogElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDialogElement { document: &Document) -> HTMLDialogElement {
HTMLDialogElement { HTMLDialogElement {
@ -29,7 +30,7 @@ impl HTMLDialogElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDialogElement> { document: &Document) -> Root<HTMLDialogElement> {
let element = HTMLDialogElement::new_inherited(localName, prefix, document); let element = HTMLDialogElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLDirectoryElement {
} }
impl HTMLDirectoryElement { impl HTMLDirectoryElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDirectoryElement { document: &Document) -> HTMLDirectoryElement {
HTMLDirectoryElement { HTMLDirectoryElement {
@ -25,7 +26,7 @@ impl HTMLDirectoryElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDirectoryElement> { document: &Document) -> Root<HTMLDirectoryElement> {
let element = HTMLDirectoryElement::new_inherited(localName, prefix, document); let element = HTMLDirectoryElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLDivElement {
} }
impl HTMLDivElement { impl HTMLDivElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLDivElement { document: &Document) -> HTMLDivElement {
HTMLDivElement { HTMLDivElement {
@ -24,7 +25,7 @@ impl HTMLDivElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDivElement> { document: &Document) -> Root<HTMLDivElement> {
let element = HTMLDivElement::new_inherited(localName, prefix, document); let element = HTMLDivElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLDListElement {
} }
impl HTMLDListElement { impl HTMLDListElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLDListElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLDListElement {
HTMLDListElement { HTMLDListElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(localName, prefix, document) HTMLElement::new_inherited(localName, prefix, document)
@ -23,7 +24,7 @@ impl HTMLDListElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLDListElement> { document: &Document) -> Root<HTMLDListElement> {
let element = HTMLDListElement::new_inherited(localName, prefix, document); let element = HTMLDListElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -54,12 +54,12 @@ impl PartialEq for HTMLElement {
} }
impl HTMLElement { impl HTMLElement {
pub fn new_inherited(tag_name: DOMString, prefix: Option<DOMString>, pub fn new_inherited(tag_name: Atom, prefix: Option<DOMString>,
document: &Document) -> HTMLElement { document: &Document) -> HTMLElement {
HTMLElement::new_inherited_with_state(ElementState::empty(), tag_name, prefix, document) HTMLElement::new_inherited_with_state(ElementState::empty(), tag_name, prefix, document)
} }
pub fn new_inherited_with_state(state: ElementState, tag_name: DOMString, pub fn new_inherited_with_state(state: ElementState, tag_name: Atom,
prefix: Option<DOMString>, document: &Document) prefix: Option<DOMString>, document: &Document)
-> HTMLElement { -> HTMLElement {
HTMLElement { HTMLElement {
@ -71,7 +71,7 @@ impl HTMLElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> { pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document) -> Root<HTMLElement> {
let element = HTMLElement::new_inherited(localName, prefix, document); let element = HTMLElement::new_inherited(localName, prefix, document);
Node::reflect_node(box element, document, HTMLElementBinding::Wrap) Node::reflect_node(box element, document, HTMLElementBinding::Wrap)
} }

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,14 +16,14 @@ pub struct HTMLEmbedElement {
} }
impl HTMLEmbedElement { impl HTMLEmbedElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLEmbedElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLEmbedElement {
HTMLEmbedElement { HTMLEmbedElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLEmbedElement> { document: &Document) -> Root<HTMLEmbedElement> {
let element = HTMLEmbedElement::new_inherited(localName, prefix, document); let element = HTMLEmbedElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -17,6 +17,7 @@ use dom::node::{Node, window_from_node};
use dom::validitystate::ValidityState; use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use selectors::states::*; use selectors::states::*;
use string_cache::Atom;
use util::str::{DOMString, StaticStringVec}; use util::str::{DOMString, StaticStringVec};
#[dom_struct] #[dom_struct]
@ -25,7 +26,7 @@ pub struct HTMLFieldSetElement {
} }
impl HTMLFieldSetElement { impl HTMLFieldSetElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLFieldSetElement { document: &Document) -> HTMLFieldSetElement {
HTMLFieldSetElement { HTMLFieldSetElement {
@ -36,7 +37,7 @@ impl HTMLFieldSetElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFieldSetElement> { document: &Document) -> Root<HTMLFieldSetElement> {
let element = HTMLFieldSetElement::new_inherited(localName, prefix, document); let element = HTMLFieldSetElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -24,14 +24,14 @@ pub struct HTMLFontElement {
impl HTMLFontElement { impl HTMLFontElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLFontElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFontElement {
HTMLFontElement { HTMLFontElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(localName, prefix, document),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFontElement> { document: &Document) -> Root<HTMLFontElement> {
let element = HTMLFontElement::new_inherited(localName, prefix, document); let element = HTMLFontElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -49,7 +49,7 @@ impl PartialEq for HTMLFormElement {
} }
impl HTMLFormElement { impl HTMLFormElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLFormElement { document: &Document) -> HTMLFormElement {
HTMLFormElement { HTMLFormElement {
@ -59,7 +59,7 @@ impl HTMLFormElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFormElement> { document: &Document) -> Root<HTMLFormElement> {
let element = HTMLFormElement::new_inherited(localName, prefix, document); let element = HTMLFormElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,14 +16,14 @@ pub struct HTMLFrameElement {
} }
impl HTMLFrameElement { impl HTMLFrameElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLFrameElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLFrameElement {
HTMLFrameElement { HTMLFrameElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFrameElement> { document: &Document) -> Root<HTMLFrameElement> {
let element = HTMLFrameElement::new_inherited(localName, prefix, document); let element = HTMLFrameElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLFrameSetElement {
} }
impl HTMLFrameSetElement { impl HTMLFrameSetElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLFrameSetElement { document: &Document) -> HTMLFrameSetElement {
HTMLFrameSetElement { HTMLFrameSetElement {
@ -25,7 +26,7 @@ impl HTMLFrameSetElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLFrameSetElement> { document: &Document) -> Root<HTMLFrameSetElement> {
let element = HTMLFrameSetElement::new_inherited(localName, prefix, document); let element = HTMLFrameSetElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -10,6 +10,7 @@ use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use dom::userscripts::load_script; use dom::userscripts::load_script;
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -18,7 +19,7 @@ pub struct HTMLHeadElement {
} }
impl HTMLHeadElement { impl HTMLHeadElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLHeadElement { document: &Document) -> HTMLHeadElement {
HTMLHeadElement { HTMLHeadElement {
@ -27,7 +28,7 @@ impl HTMLHeadElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLHeadElement> { document: &Document) -> Root<HTMLHeadElement> {
let element = HTMLHeadElement::new_inherited(localName, prefix, document); let element = HTMLHeadElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[derive(JSTraceable, HeapSizeOf)] #[derive(JSTraceable, HeapSizeOf)]
@ -26,7 +27,7 @@ pub struct HTMLHeadingElement {
} }
impl HTMLHeadingElement { impl HTMLHeadingElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document, document: &Document,
level: HeadingLevel) -> HTMLHeadingElement { level: HeadingLevel) -> HTMLHeadingElement {
@ -38,7 +39,7 @@ impl HTMLHeadingElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document, document: &Document,
level: HeadingLevel) -> Root<HTMLHeadingElement> { level: HeadingLevel) -> Root<HTMLHeadingElement> {

Просмотреть файл

@ -21,14 +21,14 @@ pub struct HTMLHRElement {
} }
impl HTMLHRElement { impl HTMLHRElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLHRElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLHRElement {
HTMLHRElement { HTMLHRElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLHRElement> { document: &Document) -> Root<HTMLHRElement> {
let element = HTMLHRElement::new_inherited(localName, prefix, document); let element = HTMLHRElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,14 +16,14 @@ pub struct HTMLHtmlElement {
} }
impl HTMLHtmlElement { impl HTMLHtmlElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLHtmlElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLHtmlElement {
HTMLHtmlElement { HTMLHtmlElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLHtmlElement> { document: &Document) -> Root<HTMLHtmlElement> {
let element = HTMLHtmlElement::new_inherited(localName, prefix, document); let element = HTMLHtmlElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -160,7 +160,7 @@ impl HTMLIFrameElement {
self.subpage_id.set(Some(new_subpage_id)); self.subpage_id.set(Some(new_subpage_id));
} }
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLIFrameElement { document: &Document) -> HTMLIFrameElement {
HTMLIFrameElement { HTMLIFrameElement {
@ -173,7 +173,7 @@ impl HTMLIFrameElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLIFrameElement> { document: &Document) -> Root<HTMLIFrameElement> {
let element = HTMLIFrameElement::new_inherited(localName, prefix, document); let element = HTMLIFrameElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -128,7 +128,7 @@ impl HTMLImageElement {
} }
} }
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLImageElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLImageElement {
HTMLImageElement { HTMLImageElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(localName, prefix, document),
url: DOMRefCell::new(None), url: DOMRefCell::new(None),
@ -137,7 +137,7 @@ impl HTMLImageElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLImageElement> { document: &Document) -> Root<HTMLImageElement> {
let element = HTMLImageElement::new_inherited(localName, prefix, document); let element = HTMLImageElement::new_inherited(localName, prefix, document);
@ -148,7 +148,7 @@ impl HTMLImageElement {
width: Option<u32>, width: Option<u32>,
height: Option<u32>) -> Fallible<Root<HTMLImageElement>> { height: Option<u32>) -> Fallible<Root<HTMLImageElement>> {
let document = global.as_window().Document(); let document = global.as_window().Document();
let image = HTMLImageElement::new(DOMString::from("img"), None, document.r()); let image = HTMLImageElement::new(atom!("img"), None, document.r());
if let Some(w) = width { if let Some(w) = width {
image.SetWidth(w); image.SetWidth(w);
} }

Просмотреть файл

@ -107,7 +107,7 @@ static DEFAULT_INPUT_SIZE: u32 = 20;
static DEFAULT_MAX_LENGTH: i32 = -1; static DEFAULT_MAX_LENGTH: i32 = -1;
impl HTMLInputElement { impl HTMLInputElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLInputElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLInputElement {
let chan = document.window().constellation_chan(); let chan = document.window().constellation_chan();
HTMLInputElement { HTMLInputElement {
htmlelement: htmlelement:
@ -125,7 +125,7 @@ impl HTMLInputElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLInputElement> { document: &Document) -> Root<HTMLInputElement> {
let element = HTMLInputElement::new_inherited(localName, prefix, document); let element = HTMLInputElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -25,7 +25,7 @@ pub struct HTMLLabelElement {
} }
impl HTMLLabelElement { impl HTMLLabelElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLLabelElement { document: &Document) -> HTMLLabelElement {
HTMLLabelElement { HTMLLabelElement {
@ -35,7 +35,7 @@ impl HTMLLabelElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLLabelElement> { document: &Document) -> Root<HTMLLabelElement> {
let element = HTMLLabelElement::new_inherited(localName, prefix, document); let element = HTMLLabelElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLLegendElement {
} }
impl HTMLLegendElement { impl HTMLLegendElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLLegendElement { document: &Document) -> HTMLLegendElement {
HTMLLegendElement { HTMLLegendElement {
@ -25,7 +26,7 @@ impl HTMLLegendElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLLegendElement> { document: &Document) -> Root<HTMLLegendElement> {
let element = HTMLLegendElement::new_inherited(localName, prefix, document); let element = HTMLLegendElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,14 +16,14 @@ pub struct HTMLLIElement {
} }
impl HTMLLIElement { impl HTMLLIElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLLIElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLLIElement {
HTMLLIElement { HTMLLIElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLLIElement> { document: &Document) -> Root<HTMLLIElement> {
let element = HTMLLIElement::new_inherited(localName, prefix, document); let element = HTMLLIElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -53,7 +53,7 @@ pub struct HTMLLinkElement {
} }
impl HTMLLinkElement { impl HTMLLinkElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document, fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document,
creator: ElementCreator) -> HTMLLinkElement { creator: ElementCreator) -> HTMLLinkElement {
HTMLLinkElement { HTMLLinkElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(localName, prefix, document),
@ -64,7 +64,7 @@ impl HTMLLinkElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document, document: &Document,
creator: ElementCreator) -> Root<HTMLLinkElement> { creator: ElementCreator) -> Root<HTMLLinkElement> {

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLMapElement {
} }
impl HTMLMapElement { impl HTMLMapElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLMapElement { document: &Document) -> HTMLMapElement {
HTMLMapElement { HTMLMapElement {
@ -24,7 +25,7 @@ impl HTMLMapElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLMapElement> { document: &Document) -> Root<HTMLMapElement> {
let element = HTMLMapElement::new_inherited(localName, prefix, document); let element = HTMLMapElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -4,6 +4,7 @@
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -12,7 +13,7 @@ pub struct HTMLMediaElement {
} }
impl HTMLMediaElement { impl HTMLMediaElement {
pub fn new_inherited(tag_name: DOMString, pub fn new_inherited(tag_name: Atom,
prefix: Option<DOMString>, document: &Document) prefix: Option<DOMString>, document: &Document)
-> HTMLMediaElement { -> HTMLMediaElement {
HTMLMediaElement { HTMLMediaElement {

Просмотреть файл

@ -14,6 +14,7 @@ use dom::node::{Node, document_from_node};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
use std::sync::Arc; use std::sync::Arc;
use string_cache::Atom;
use style::stylesheets::{CSSRule, Origin, Stylesheet}; use style::stylesheets::{CSSRule, Origin, Stylesheet};
use style::viewport::ViewportRule; use style::viewport::ViewportRule;
use util::str::{DOMString, HTML_SPACE_CHARACTERS}; use util::str::{DOMString, HTML_SPACE_CHARACTERS};
@ -25,7 +26,7 @@ pub struct HTMLMetaElement {
} }
impl HTMLMetaElement { impl HTMLMetaElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLMetaElement { document: &Document) -> HTMLMetaElement {
HTMLMetaElement { HTMLMetaElement {
@ -35,7 +36,7 @@ impl HTMLMetaElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLMetaElement> { document: &Document) -> Root<HTMLMetaElement> {
let element = HTMLMetaElement::new_inherited(localName, prefix, document); let element = HTMLMetaElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -9,6 +9,7 @@ use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use dom::nodelist::NodeList; use dom::nodelist::NodeList;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -17,7 +18,7 @@ pub struct HTMLMeterElement {
} }
impl HTMLMeterElement { impl HTMLMeterElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLMeterElement { document: &Document) -> HTMLMeterElement {
HTMLMeterElement { HTMLMeterElement {
@ -26,7 +27,7 @@ impl HTMLMeterElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLMeterElement> { document: &Document) -> Root<HTMLMeterElement> {
let element = HTMLMeterElement::new_inherited(localName, prefix, document); let element = HTMLMeterElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLModElement {
} }
impl HTMLModElement { impl HTMLModElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLModElement { document: &Document) -> HTMLModElement {
HTMLModElement { HTMLModElement {
@ -25,7 +26,7 @@ impl HTMLModElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLModElement> { document: &Document) -> Root<HTMLModElement> {
let element = HTMLModElement::new_inherited(localName, prefix, document); let element = HTMLModElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -17,6 +17,7 @@ use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use net_traits::image::base::Image; use net_traits::image::base::Image;
use std::sync::Arc; use std::sync::Arc;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -26,7 +27,7 @@ pub struct HTMLObjectElement {
} }
impl HTMLObjectElement { impl HTMLObjectElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLObjectElement { document: &Document) -> HTMLObjectElement {
HTMLObjectElement { HTMLObjectElement {
@ -37,7 +38,7 @@ impl HTMLObjectElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLObjectElement> { document: &Document) -> Root<HTMLObjectElement> {
let element = HTMLObjectElement::new_inherited(localName, prefix, document); let element = HTMLObjectElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLOListElement {
} }
impl HTMLOListElement { impl HTMLOListElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOListElement { document: &Document) -> HTMLOListElement {
HTMLOListElement { HTMLOListElement {
@ -24,7 +25,7 @@ impl HTMLOListElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOListElement> { document: &Document) -> Root<HTMLOListElement> {
let element = HTMLOListElement::new_inherited(localName, prefix, document); let element = HTMLOListElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -14,6 +14,7 @@ use dom::htmloptionelement::HTMLOptionElement;
use dom::node::Node; use dom::node::Node;
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use selectors::states::*; use selectors::states::*;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -22,7 +23,7 @@ pub struct HTMLOptGroupElement {
} }
impl HTMLOptGroupElement { impl HTMLOptGroupElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOptGroupElement { document: &Document) -> HTMLOptGroupElement {
HTMLOptGroupElement { HTMLOptGroupElement {
@ -33,7 +34,7 @@ impl HTMLOptGroupElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOptGroupElement> { document: &Document) -> Root<HTMLOptGroupElement> {
let element = HTMLOptGroupElement::new_inherited(localName, prefix, document); let element = HTMLOptGroupElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -20,6 +20,7 @@ use dom::text::Text;
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use selectors::states::*; use selectors::states::*;
use std::cell::Cell; use std::cell::Cell;
use string_cache::Atom;
use util::str::{DOMString, split_html_space_chars, str_join}; use util::str::{DOMString, split_html_space_chars, str_join};
#[dom_struct] #[dom_struct]
@ -34,7 +35,7 @@ pub struct HTMLOptionElement {
} }
impl HTMLOptionElement { impl HTMLOptionElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOptionElement { document: &Document) -> HTMLOptionElement {
HTMLOptionElement { HTMLOptionElement {
@ -47,7 +48,7 @@ impl HTMLOptionElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOptionElement> { document: &Document) -> Root<HTMLOptionElement> {
let element = HTMLOptionElement::new_inherited(localName, prefix, document); let element = HTMLOptionElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -12,6 +12,7 @@ use dom::htmlformelement::{FormControl, HTMLFormElement};
use dom::node::{Node, window_from_node}; use dom::node::{Node, window_from_node};
use dom::nodelist::NodeList; use dom::nodelist::NodeList;
use dom::validitystate::ValidityState; use dom::validitystate::ValidityState;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -20,7 +21,7 @@ pub struct HTMLOutputElement {
} }
impl HTMLOutputElement { impl HTMLOutputElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLOutputElement { document: &Document) -> HTMLOutputElement {
HTMLOutputElement { HTMLOutputElement {
@ -30,7 +31,7 @@ impl HTMLOutputElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLOutputElement> { document: &Document) -> Root<HTMLOutputElement> {
let element = HTMLOutputElement::new_inherited(localName, prefix, document); let element = HTMLOutputElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLParagraphElement {
} }
impl HTMLParagraphElement { impl HTMLParagraphElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLParagraphElement { document: &Document) -> HTMLParagraphElement {
HTMLParagraphElement { HTMLParagraphElement {
@ -25,7 +26,7 @@ impl HTMLParagraphElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLParagraphElement> { document: &Document) -> Root<HTMLParagraphElement> {
let element = HTMLParagraphElement::new_inherited(localName, prefix, document); let element = HTMLParagraphElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLParamElement {
} }
impl HTMLParamElement { impl HTMLParamElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLParamElement { document: &Document) -> HTMLParamElement {
HTMLParamElement { HTMLParamElement {
@ -25,7 +26,7 @@ impl HTMLParamElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLParamElement> { document: &Document) -> Root<HTMLParamElement> {
let element = HTMLParamElement::new_inherited(localName, prefix, document); let element = HTMLParamElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLPreElement {
} }
impl HTMLPreElement { impl HTMLPreElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLPreElement { document: &Document) -> HTMLPreElement {
HTMLPreElement { HTMLPreElement {
@ -25,7 +26,7 @@ impl HTMLPreElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLPreElement> { document: &Document) -> Root<HTMLPreElement> {
let element = HTMLPreElement::new_inherited(localName, prefix, document); let element = HTMLPreElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -9,6 +9,7 @@ use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use dom::nodelist::NodeList; use dom::nodelist::NodeList;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -17,7 +18,7 @@ pub struct HTMLProgressElement {
} }
impl HTMLProgressElement { impl HTMLProgressElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLProgressElement { document: &Document) -> HTMLProgressElement {
HTMLProgressElement { HTMLProgressElement {
@ -27,7 +28,7 @@ impl HTMLProgressElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLProgressElement> { document: &Document) -> Root<HTMLProgressElement> {
let element = HTMLProgressElement::new_inherited(localName, prefix, document); let element = HTMLProgressElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLQuoteElement {
} }
impl HTMLQuoteElement { impl HTMLQuoteElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLQuoteElement { document: &Document) -> HTMLQuoteElement {
HTMLQuoteElement { HTMLQuoteElement {
@ -25,7 +26,7 @@ impl HTMLQuoteElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLQuoteElement> { document: &Document) -> Root<HTMLQuoteElement> {
let element = HTMLQuoteElement::new_inherited(localName, prefix, document); let element = HTMLQuoteElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -40,6 +40,7 @@ use std::ascii::AsciiExt;
use std::cell::Cell; use std::cell::Cell;
use std::mem; use std::mem;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use string_cache::Atom;
use url::{Url, UrlParser}; use url::{Url, UrlParser};
use util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec}; use util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec};
@ -73,7 +74,7 @@ pub struct HTMLScriptElement {
} }
impl HTMLScriptElement { impl HTMLScriptElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document, fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document,
creator: ElementCreator) -> HTMLScriptElement { creator: ElementCreator) -> HTMLScriptElement {
HTMLScriptElement { HTMLScriptElement {
htmlelement: htmlelement:
@ -89,7 +90,7 @@ impl HTMLScriptElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, prefix: Option<DOMString>, document: &Document, pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document,
creator: ElementCreator) -> Root<HTMLScriptElement> { creator: ElementCreator) -> Root<HTMLScriptElement> {
let element = HTMLScriptElement::new_inherited(localName, prefix, document, creator); let element = HTMLScriptElement::new_inherited(localName, prefix, document, creator);
Node::reflect_node(box element, document, HTMLScriptElementBinding::Wrap) Node::reflect_node(box element, document, HTMLScriptElementBinding::Wrap)

Просмотреть файл

@ -32,7 +32,7 @@ pub struct HTMLSelectElement {
static DEFAULT_SELECT_SIZE: u32 = 0; static DEFAULT_SELECT_SIZE: u32 = 0;
impl HTMLSelectElement { impl HTMLSelectElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLSelectElement { document: &Document) -> HTMLSelectElement {
HTMLSelectElement { HTMLSelectElement {
@ -43,7 +43,7 @@ impl HTMLSelectElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLSelectElement> { document: &Document) -> Root<HTMLSelectElement> {
let element = HTMLSelectElement::new_inherited(localName, prefix, document); let element = HTMLSelectElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLSourceElement {
} }
impl HTMLSourceElement { impl HTMLSourceElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLSourceElement { document: &Document) -> HTMLSourceElement {
HTMLSourceElement { HTMLSourceElement {
@ -25,7 +26,7 @@ impl HTMLSourceElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLSourceElement> { document: &Document) -> Root<HTMLSourceElement> {
let element = HTMLSourceElement::new_inherited(localName, prefix, document); let element = HTMLSourceElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,14 +16,14 @@ pub struct HTMLSpanElement {
} }
impl HTMLSpanElement { impl HTMLSpanElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLSpanElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLSpanElement {
HTMLSpanElement { HTMLSpanElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLSpanElement> { document: &Document) -> Root<HTMLSpanElement> {
let element = HTMLSpanElement::new_inherited(localName, prefix, document); let element = HTMLSpanElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -15,6 +15,7 @@ use dom::node::{ChildrenMutation, Node, document_from_node, window_from_node};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use layout_interface::{LayoutChan, Msg}; use layout_interface::{LayoutChan, Msg};
use std::sync::Arc; use std::sync::Arc;
use string_cache::Atom;
use style::media_queries::parse_media_query_list; use style::media_queries::parse_media_query_list;
use style::stylesheets::{Origin, Stylesheet}; use style::stylesheets::{Origin, Stylesheet};
use util::str::DOMString; use util::str::DOMString;
@ -26,7 +27,7 @@ pub struct HTMLStyleElement {
} }
impl HTMLStyleElement { impl HTMLStyleElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLStyleElement { document: &Document) -> HTMLStyleElement {
HTMLStyleElement { HTMLStyleElement {
@ -36,7 +37,7 @@ impl HTMLStyleElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLStyleElement> { document: &Document) -> Root<HTMLStyleElement> {
let element = HTMLStyleElement::new_inherited(localName, prefix, document); let element = HTMLStyleElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLTableCaptionElement {
} }
impl HTMLTableCaptionElement { impl HTMLTableCaptionElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableCaptionElement { document: &Document) -> HTMLTableCaptionElement {
HTMLTableCaptionElement { HTMLTableCaptionElement {
@ -25,7 +26,7 @@ impl HTMLTableCaptionElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTableCaptionElement> { document: &Document) -> Root<HTMLTableCaptionElement> {
let element = HTMLTableCaptionElement::new_inherited(localName, prefix, document); let element = HTMLTableCaptionElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -27,7 +27,7 @@ pub struct HTMLTableCellElement {
} }
impl HTMLTableCellElement { impl HTMLTableCellElement {
pub fn new_inherited(tag_name: DOMString, pub fn new_inherited(tag_name: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) document: &Document)
-> HTMLTableCellElement { -> HTMLTableCellElement {

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLTableColElement {
} }
impl HTMLTableColElement { impl HTMLTableColElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableColElement { document: &Document) -> HTMLTableColElement {
HTMLTableColElement { HTMLTableColElement {
@ -25,7 +26,7 @@ impl HTMLTableColElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTableColElement> { document: &Document) -> Root<HTMLTableColElement> {
let element = HTMLTableColElement::new_inherited(localName, prefix, document); let element = HTMLTableColElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmltablecellelement::HTMLTableCellElement; use dom::htmltablecellelement::HTMLTableCellElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLTableDataCellElement {
} }
impl HTMLTableDataCellElement { impl HTMLTableDataCellElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableDataCellElement { document: &Document) -> HTMLTableDataCellElement {
HTMLTableDataCellElement { HTMLTableDataCellElement {
@ -25,7 +26,7 @@ impl HTMLTableDataCellElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, prefix: Option<DOMString>, document: &Document) pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableDataCellElement> { -> Root<HTMLTableDataCellElement> {
Node::reflect_node(box HTMLTableDataCellElement::new_inherited(localName, Node::reflect_node(box HTMLTableDataCellElement::new_inherited(localName,
prefix, prefix,

Просмотреть файл

@ -29,7 +29,7 @@ pub struct HTMLTableElement {
} }
impl HTMLTableElement { impl HTMLTableElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLTableElement { -> HTMLTableElement {
HTMLTableElement { HTMLTableElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(localName, prefix, document),
@ -40,7 +40,7 @@ impl HTMLTableElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, prefix: Option<DOMString>, document: &Document) pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableElement> { -> Root<HTMLTableElement> {
let element = HTMLTableElement::new_inherited(localName, prefix, document); let element = HTMLTableElement::new_inherited(localName, prefix, document);
Node::reflect_node(box element, document, HTMLTableElementBinding::Wrap) Node::reflect_node(box element, document, HTMLTableElementBinding::Wrap)
@ -75,7 +75,7 @@ impl HTMLTableElementMethods for HTMLTableElement {
let caption = match self.GetCaption() { let caption = match self.GetCaption() {
Some(caption) => caption, Some(caption) => caption,
None => { None => {
let caption = HTMLTableCaptionElement::new(DOMString::from("caption"), let caption = HTMLTableCaptionElement::new(atom!("caption"),
None, None,
document_from_node(self).r()); document_from_node(self).r());
self.SetCaption(Some(caption.r())); self.SetCaption(Some(caption.r()));
@ -94,7 +94,7 @@ impl HTMLTableElementMethods for HTMLTableElement {
// https://html.spec.whatwg.org/multipage/#dom-table-createtbody // https://html.spec.whatwg.org/multipage/#dom-table-createtbody
fn CreateTBody(&self) -> Root<HTMLTableSectionElement> { fn CreateTBody(&self) -> Root<HTMLTableSectionElement> {
let tbody = HTMLTableSectionElement::new(DOMString::from("tbody"), let tbody = HTMLTableSectionElement::new(atom!("tbody"),
None, None,
document_from_node(self).r()); document_from_node(self).r());
let node = self.upcast::<Node>(); let node = self.upcast::<Node>();

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmltablecellelement::HTMLTableCellElement; use dom::htmltablecellelement::HTMLTableCellElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLTableHeaderCellElement {
} }
impl HTMLTableHeaderCellElement { impl HTMLTableHeaderCellElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTableHeaderCellElement { document: &Document) -> HTMLTableHeaderCellElement {
HTMLTableHeaderCellElement { HTMLTableHeaderCellElement {
@ -25,7 +26,7 @@ impl HTMLTableHeaderCellElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTableHeaderCellElement> { document: &Document) -> Root<HTMLTableHeaderCellElement> {
let element = HTMLTableHeaderCellElement::new_inherited(localName, prefix, document); let element = HTMLTableHeaderCellElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -37,7 +37,7 @@ pub struct HTMLTableRowElement {
} }
impl HTMLTableRowElement { impl HTMLTableRowElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLTableRowElement { -> HTMLTableRowElement {
HTMLTableRowElement { HTMLTableRowElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(localName, prefix, document),
@ -46,7 +46,7 @@ impl HTMLTableRowElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, prefix: Option<DOMString>, document: &Document) pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableRowElement> { -> Root<HTMLTableRowElement> {
Node::reflect_node(box HTMLTableRowElement::new_inherited(localName, prefix, document), Node::reflect_node(box HTMLTableRowElement::new_inherited(localName, prefix, document),
document, document,
@ -76,7 +76,7 @@ impl HTMLTableRowElementMethods for HTMLTableRowElement {
node.insert_cell_or_row( node.insert_cell_or_row(
index, index,
|| self.Cells(), || self.Cells(),
|| HTMLTableDataCellElement::new(DOMString::from("td"), None, node.owner_doc().r())) || HTMLTableDataCellElement::new(atom!("td"), None, node.owner_doc().r()))
} }
// https://html.spec.whatwg.org/multipage/#dom-tr-deletecell // https://html.spec.whatwg.org/multipage/#dom-tr-deletecell

Просмотреть файл

@ -25,7 +25,7 @@ pub struct HTMLTableSectionElement {
} }
impl HTMLTableSectionElement { impl HTMLTableSectionElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document)
-> HTMLTableSectionElement { -> HTMLTableSectionElement {
HTMLTableSectionElement { HTMLTableSectionElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document), htmlelement: HTMLElement::new_inherited(localName, prefix, document),
@ -33,7 +33,7 @@ impl HTMLTableSectionElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, prefix: Option<DOMString>, document: &Document) pub fn new(localName: Atom, prefix: Option<DOMString>, document: &Document)
-> Root<HTMLTableSectionElement> { -> Root<HTMLTableSectionElement> {
let element = HTMLTableSectionElement::new_inherited(localName, prefix, document); let element = HTMLTableSectionElement::new_inherited(localName, prefix, document);
Node::reflect_node(box element, document, HTMLTableSectionElementBinding::Wrap) Node::reflect_node(box element, document, HTMLTableSectionElementBinding::Wrap)
@ -61,7 +61,7 @@ impl HTMLTableSectionElementMethods for HTMLTableSectionElement {
node.insert_cell_or_row( node.insert_cell_or_row(
index, index,
|| self.Rows(), || self.Rows(),
|| HTMLTableRowElement::new(DOMString::from("tr"), None, node.owner_doc().r())) || HTMLTableRowElement::new(atom!("tr"), None, node.owner_doc().r()))
} }
// https://html.spec.whatwg.org/multipage/#dom-tbody-deleterow // https://html.spec.whatwg.org/multipage/#dom-tbody-deleterow

Просмотреть файл

@ -13,6 +13,7 @@ use dom::documentfragment::DocumentFragment;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{CloneChildrenFlag, Node, document_from_node}; use dom::node::{CloneChildrenFlag, Node, document_from_node};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -24,7 +25,7 @@ pub struct HTMLTemplateElement {
} }
impl HTMLTemplateElement { impl HTMLTemplateElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTemplateElement { document: &Document) -> HTMLTemplateElement {
HTMLTemplateElement { HTMLTemplateElement {
@ -35,7 +36,7 @@ impl HTMLTemplateElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTemplateElement> { document: &Document) -> Root<HTMLTemplateElement> {
let element = HTMLTemplateElement::new_inherited(localName, prefix, document); let element = HTMLTemplateElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -91,7 +91,7 @@ static DEFAULT_COLS: u32 = 20;
static DEFAULT_ROWS: u32 = 2; static DEFAULT_ROWS: u32 = 2;
impl HTMLTextAreaElement { impl HTMLTextAreaElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLTextAreaElement { document: &Document) -> HTMLTextAreaElement {
let chan = document.window().constellation_chan(); let chan = document.window().constellation_chan();
@ -107,7 +107,7 @@ impl HTMLTextAreaElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTextAreaElement> { document: &Document) -> Root<HTMLTextAreaElement> {
let element = HTMLTextAreaElement::new_inherited(localName, prefix, document); let element = HTMLTextAreaElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,14 +16,14 @@ pub struct HTMLTimeElement {
} }
impl HTMLTimeElement { impl HTMLTimeElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLTimeElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTimeElement {
HTMLTimeElement { HTMLTimeElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTimeElement> { document: &Document) -> Root<HTMLTimeElement> {
let element = HTMLTimeElement::new_inherited(localName, prefix, document); let element = HTMLTimeElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -13,6 +13,7 @@ use dom::htmlelement::HTMLElement;
use dom::node::{ChildrenMutation, Node}; use dom::node::{ChildrenMutation, Node};
use dom::text::Text; use dom::text::Text;
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -21,14 +22,14 @@ pub struct HTMLTitleElement {
} }
impl HTMLTitleElement { impl HTMLTitleElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLTitleElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTitleElement {
HTMLTitleElement { HTMLTitleElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTitleElement> { document: &Document) -> Root<HTMLTitleElement> {
let element = HTMLTitleElement::new_inherited(localName, prefix, document); let element = HTMLTitleElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,14 +16,14 @@ pub struct HTMLTrackElement {
} }
impl HTMLTrackElement { impl HTMLTrackElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLTrackElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLTrackElement {
HTMLTrackElement { HTMLTrackElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLTrackElement> { document: &Document) -> Root<HTMLTrackElement> {
let element = HTMLTrackElement::new_inherited(localName, prefix, document); let element = HTMLTrackElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,14 +16,14 @@ pub struct HTMLUListElement {
} }
impl HTMLUListElement { impl HTMLUListElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLUListElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLUListElement {
HTMLUListElement { HTMLUListElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document) htmlelement: HTMLElement::new_inherited(localName, prefix, document)
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLUListElement> { document: &Document) -> Root<HTMLUListElement> {
let element = HTMLUListElement::new_inherited(localName, prefix, document); let element = HTMLUListElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLUnknownElement {
} }
impl HTMLUnknownElement { impl HTMLUnknownElement {
fn new_inherited(localName: DOMString, fn new_inherited(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> HTMLUnknownElement { document: &Document) -> HTMLUnknownElement {
HTMLUnknownElement { HTMLUnknownElement {
@ -25,7 +26,7 @@ impl HTMLUnknownElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLUnknownElement> { document: &Document) -> Root<HTMLUnknownElement> {
let element = HTMLUnknownElement::new_inherited(localName, prefix, document); let element = HTMLUnknownElement::new_inherited(localName, prefix, document);

Просмотреть файл

@ -7,6 +7,7 @@ use dom::bindings::js::Root;
use dom::document::Document; use dom::document::Document;
use dom::htmlmediaelement::HTMLMediaElement; use dom::htmlmediaelement::HTMLMediaElement;
use dom::node::Node; use dom::node::Node;
use string_cache::Atom;
use util::str::DOMString; use util::str::DOMString;
#[dom_struct] #[dom_struct]
@ -15,7 +16,7 @@ pub struct HTMLVideoElement {
} }
impl HTMLVideoElement { impl HTMLVideoElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: &Document) -> HTMLVideoElement { fn new_inherited(localName: Atom, prefix: Option<DOMString>, document: &Document) -> HTMLVideoElement {
HTMLVideoElement { HTMLVideoElement {
htmlmediaelement: htmlmediaelement:
HTMLMediaElement::new_inherited(localName, prefix, document) HTMLMediaElement::new_inherited(localName, prefix, document)
@ -23,7 +24,7 @@ impl HTMLVideoElement {
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, pub fn new(localName: Atom,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: &Document) -> Root<HTMLVideoElement> { document: &Document) -> Root<HTMLVideoElement> {
let element = HTMLVideoElement::new_inherited(localName, prefix, document); let element = HTMLVideoElement::new_inherited(localName, prefix, document);