Use DOMString::new() somewhat consistently.

This commit is contained in:
Ms2ger 2015-11-03 14:11:07 +01:00
parent dab3926622
commit e6aa976462
24 changed files with 67 additions and 68 deletions

View file

@ -784,14 +784,14 @@ impl Node {
baseURI: self.BaseURI(),
parent: self.GetParentNode().map(|node| node.get_unique_id()).unwrap_or("".to_owned()),
nodeType: self.NodeType(),
namespaceURI: "".to_owned(), //FIXME
namespaceURI: DOMString::new(), //FIXME
nodeName: self.NodeName(),
numChildren: self.ChildNodes().Length() as usize,
//FIXME doctype nodes only
name: "".to_owned(),
publicId: "".to_owned(),
systemId: "".to_owned(),
name: DOMString::new(),
publicId: DOMString::new(),
systemId: DOMString::new(),
attrs: self.downcast().map(Element::summarize).unwrap_or(vec![]),
isDocumentElement:
@ -800,7 +800,7 @@ impl Node {
.map(|elem| elem.upcast::<Node>() == self)
.unwrap_or(false),
shortValue: self.GetNodeValue().unwrap_or("".to_owned()), //FIXME: truncate
shortValue: self.GetNodeValue().unwrap_or(DOMString::new()), //FIXME: truncate
incompleteValue: false, //FIXME: reflect truncation
}
}
@ -1903,7 +1903,7 @@ impl NodeMethods for Node {
// https://dom.spec.whatwg.org/#dom-node-textcontent
fn SetTextContent(&self, value: Option<DOMString>) {
let value = value.unwrap_or(String::new());
let value = value.unwrap_or(DOMString::new());
match self.type_id() {
NodeTypeId::DocumentFragment |
NodeTypeId::Element(..) => {