aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/node.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-05-08 23:40:15 +0200
committerJack Moffitt <jack@metajack.im>2014-05-22 16:36:40 -0600
commiteaedeb07cb0c4fdda37f35057588e4a769fbe758 (patch)
treecdeb134482f06818f7d6dbad8e008882fcc336a5 /src/components/script/dom/node.rs
parent3644d0272c89336954358eb5005f884a9c89e8bc (diff)
downloadservo-eaedeb07cb0c4fdda37f35057588e4a769fbe758.tar.gz
servo-eaedeb07cb0c4fdda37f35057588e4a769fbe758.zip
Update Rust.
Diffstat (limited to 'src/components/script/dom/node.rs')
-rw-r--r--src/components/script/dom/node.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/script/dom/node.rs b/src/components/script/dom/node.rs
index e8be5f449aa..a05dc1e0171 100644
--- a/src/components/script/dom/node.rs
+++ b/src/components/script/dom/node.rs
@@ -169,7 +169,7 @@ impl LayoutDataRef {
}
}
- pub unsafe fn from_data<T>(data: ~T) -> LayoutDataRef {
+ pub unsafe fn from_data<T>(data: Box<T>) -> LayoutDataRef {
LayoutDataRef {
data_cell: RefCell::new(Some(cast::transmute(data))),
}
@@ -446,7 +446,7 @@ impl<'a> NodeHelpers for JSRef<'a, Node> {
/// Dumps the node tree, for debugging, with indentation.
fn dump_indent(&self, indent: uint) {
- let mut s = "".to_owned();
+ let mut s = StrBuf::new();
for _ in range(0, indent) {
s.push_str(" ");
}
@@ -887,9 +887,9 @@ fn as_uintptr<T>(t: &T) -> uintptr_t { t as *T as uintptr_t }
impl Node {
pub fn reflect_node<N: Reflectable+NodeBase>
- (node: ~N,
+ (node: Box<N>,
document: &JSRef<Document>,
- wrap_fn: extern "Rust" fn(*JSContext, &JSRef<Window>, ~N) -> JS<N>)
+ wrap_fn: extern "Rust" fn(*JSContext, &JSRef<Window>, Box<N>) -> JS<N>)
-> Temporary<N> {
assert!(node.reflector().get_jsobject().is_null());
let window = document.deref().window.root();
@@ -1513,14 +1513,14 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
match self.type_id {
DocumentFragmentNodeTypeId |
ElementNodeTypeId(..) => {
- let mut content = "".to_owned();
+ let mut content = StrBuf::new();
for node in self.traverse_preorder() {
if node.is_text() {
let text: &JSRef<Text> = TextCast::to_ref(&node).unwrap();
content.push_str(text.deref().characterdata.data.as_slice());
}
}
- Some(content)
+ Some(content.into_owned())
}
CommentNodeTypeId |
TextNodeTypeId |
@@ -1560,7 +1560,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
{
let characterdata: &mut JSRef<CharacterData> = CharacterDataCast::to_mut_ref(self).unwrap();
- characterdata.deref_mut().data = value.clone();
+ characterdata.deref_mut().data = value;
}
// Notify the document that the content of this node is different