diff options
Diffstat (limited to 'src/components/script/dom/document.rs')
-rw-r--r-- | src/components/script/dom/document.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs index c39c82449c0..3cf1d35459a 100644 --- a/src/components/script/dom/document.rs +++ b/src/components/script/dom/document.rs @@ -38,12 +38,12 @@ use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage}; use servo_util::namespace::{Namespace, Null}; use servo_util::str::DOMString; +use collections::hashmap::HashMap; use extra::url::{Url, from_str}; use js::jsapi::{JSObject, JSContext}; use std::ascii::StrAsciiExt; -use std::hashmap::HashMap; -use extra::serialize::{Encoder, Encodable}; +use serialize::{Encoder, Encodable}; #[deriving(Eq,Encodable)] pub enum IsHTMLDocument { @@ -341,17 +341,17 @@ impl Document { match title_node { Some(ref mut title_node) => { for mut title_child in title_node.children() { - title_node.RemoveChild(&mut title_child); + assert!(title_node.RemoveChild(&mut title_child).is_ok()); } let new_text = self.CreateTextNode(abstract_self, title.clone()); - title_node.AppendChild(&mut NodeCast::from(&new_text)); + assert!(title_node.AppendChild(&mut NodeCast::from(&new_text)).is_ok()); }, None => { let mut new_title: JS<Node> = NodeCast::from(&HTMLTitleElement::new(~"title", abstract_self)); let new_text = self.CreateTextNode(abstract_self, title.clone()); - new_title.AppendChild(&mut NodeCast::from(&new_text)); - head.AppendChild(&mut new_title); + assert!(new_title.AppendChild(&mut NodeCast::from(&new_text)).is_ok()); + assert!(head.AppendChild(&mut new_title).is_ok()); }, } }); @@ -418,9 +418,9 @@ impl Document { match old_body { Some(child) => { let mut child: JS<Node> = NodeCast::from(&child); - root.ReplaceChild(&mut new_body, &mut child) + assert!(root.ReplaceChild(&mut new_body, &mut child).is_ok()) } - None => root.AppendChild(&mut new_body) + None => assert!(root.AppendChild(&mut new_body).is_ok()) }; } } @@ -435,7 +435,7 @@ impl Document { } let element: JS<Element> = ElementCast::to(node); - element.get().get_attribute(Null, "name").map_default(false, |attr| { + element.get().get_attribute(Null, "name").map_or(false, |attr| { attr.get().value_ref() == name }) }) |