aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/element.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r--components/script/dom/element.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 0735e19299f..b684b90579e 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -59,6 +59,7 @@ use html5ever::tree_builder::{NoQuirks, LimitedQuirks, Quirks};
use cssparser::RGBA;
use std::ascii::AsciiExt;
+use std::borrow::ToOwned;
use std::cell::{Ref, RefMut};
use std::default::Default;
use std::mem;
@@ -761,7 +762,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
fn get_url_attribute(self, name: &Atom) -> DOMString {
assert!(name.as_slice() == name.as_slice().to_ascii_lower().as_slice());
if !self.has_attribute(name) {
- return "".into_string();
+ return "".to_owned();
}
let url = self.get_string_attribute(name);
let doc = document_from_node(self).root();
@@ -770,7 +771,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
// XXXManishearth this doesn't handle `javascript:` urls properly
match UrlParser::new().base_url(base).parse(url.as_slice()) {
Ok(parsed) => parsed.serialize(),
- Err(_) => "".into_string()
+ Err(_) => "".to_owned()
}
}
fn set_url_attribute(self, name: &Atom, value: DOMString) {
@@ -780,7 +781,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
fn get_string_attribute(self, name: &Atom) -> DOMString {
match self.get_attribute(ns!(""), name) {
Some(x) => x.root().r().Value(),
- None => "".into_string()
+ None => "".to_owned()
}
}
fn set_string_attribute(self, name: &Atom, value: DOMString) {
@@ -835,12 +836,12 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
fn GetNamespaceURI(self) -> Option<DOMString> {
match self.namespace {
ns!("") => None,
- Namespace(ref ns) => Some(ns.as_slice().into_string())
+ Namespace(ref ns) => Some(ns.as_slice().to_owned())
}
}
fn LocalName(self) -> DOMString {
- self.local_name.as_slice().into_string()
+ self.local_name.as_slice().to_owned()
}
// http://dom.spec.whatwg.org/#dom-element-prefix
@@ -996,7 +997,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
// Step 9.
let value = self.parse_attribute(&namespace, &local_name, value);
self.do_set_attribute(local_name.clone(), value, name,
- namespace.clone(), prefix.map(|s| s.into_string()),
+ namespace.clone(), prefix.map(|s| s.to_owned()),
|attr| {
*attr.local_name() == local_name &&
*attr.namespace() == namespace