mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Use DOMString::new() somewhat consistently.
This commit is contained in:
parent
dab3926622
commit
e6aa976462
24 changed files with 67 additions and 68 deletions
|
@ -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(..) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue