aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/document.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r--components/script/dom/document.rs19
1 files changed, 10 insertions, 9 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index f01dc20a7e1..d20dcda10e7 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -63,6 +63,7 @@ use layout_interface::{LayoutChan, Msg};
use string_cache::{Atom, QualName};
use url::Url;
+use std::borrow::ToOwned;
use std::collections::HashMap;
use std::collections::hash_map::{Vacant, Occupied};
use std::ascii::AsciiExt;
@@ -339,7 +340,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
self.ready_state.set(state);
let window = self.window.root();
- let event = Event::new(GlobalRef::Window(window.r()), "readystatechange".into_string(),
+ let event = Event::new(GlobalRef::Window(window.r()), "readystatechange".to_owned(),
EventBubbles::DoesNotBubble,
EventCancelable::NotCancelable).root();
let target: JSRef<EventTarget> = EventTargetCast::from_ref(self);
@@ -425,9 +426,9 @@ impl Document {
Some(string) => string.clone(),
None => match is_html_document {
// http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument
- IsHTMLDocument::HTMLDocument => "text/html".into_string(),
+ IsHTMLDocument::HTMLDocument => "text/html".to_owned(),
// http://dom.spec.whatwg.org/#concept-document-content-type
- IsHTMLDocument::NonHTMLDocument => "application/xml".into_string()
+ IsHTMLDocument::NonHTMLDocument => "application/xml".to_owned()
}
},
last_modified: DOMRefCell::new(None),
@@ -435,7 +436,7 @@ impl Document {
// http://dom.spec.whatwg.org/#concept-document-quirks
quirks_mode: Cell::new(NoQuirks),
// http://dom.spec.whatwg.org/#concept-document-encoding
- encoding_name: DOMRefCell::new("UTF-8".into_string()),
+ encoding_name: DOMRefCell::new("UTF-8".to_owned()),
is_html_document: is_html_document == IsHTMLDocument::HTMLDocument,
images: Default::default(),
embeds: Default::default(),
@@ -520,8 +521,8 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
// http://dom.spec.whatwg.org/#dom-document-compatmode
fn CompatMode(self) -> DOMString {
match self.quirks_mode.get() {
- LimitedQuirks | NoQuirks => "CSS1Compat".into_string(),
- Quirks => "BackCompat".into_string()
+ LimitedQuirks | NoQuirks => "CSS1Compat".to_owned(),
+ Quirks => "BackCompat".to_owned()
}
}
@@ -639,7 +640,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
}
let name = QualName::new(ns, Atom::from_slice(local_name_from_qname));
- Ok(Element::create(name, prefix_from_qname.map(|s| s.into_string()), self,
+ Ok(Element::create(name, prefix_from_qname.map(|s| s.to_owned()), self,
ElementCreator::ScriptCreated))
}
@@ -654,7 +655,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
let name = Atom::from_slice(local_name.as_slice());
// repetition used because string_cache::atom::Atom is non-copyable
let l_name = Atom::from_slice(local_name.as_slice());
- let value = AttrValue::String("".into_string());
+ let value = AttrValue::String("".to_owned());
Ok(Attr::new(window.r(), name, value, l_name, ns!(""), None, None))
}
@@ -802,7 +803,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
}
},
None => {
- let new_title = HTMLTitleElement::new("title".into_string(), None, self).root();
+ let new_title = HTMLTitleElement::new("title".to_owned(), None, self).root();
let new_title: JSRef<Node> = NodeCast::from_ref(new_title.r());
if !title.is_empty() {