diff options
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index f96da2f5934..b5bc0e525d5 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -825,7 +825,7 @@ impl Node { .map(|elem| elem.upcast::<Node>() == self) .unwrap_or(false), - shortValue: self.GetNodeValue().unwrap_or(DOMString::new()), //FIXME: truncate + shortValue: self.GetNodeValue().unwrap_or_default(), //FIXME: truncate incompleteValue: false, //FIXME: reflect truncation } } @@ -1893,7 +1893,7 @@ impl NodeMethods for Node { // https://dom.spec.whatwg.org/#dom-node-nodevalue fn SetNodeValue(&self, val: Option<DOMString>) { if let Some(character_data) = self.downcast::<CharacterData>() { - character_data.SetData(val.unwrap_or(DOMString::new())); + character_data.SetData(val.unwrap_or_default()); } } @@ -1918,7 +1918,7 @@ impl NodeMethods for Node { // https://dom.spec.whatwg.org/#dom-node-textcontent fn SetTextContent(&self, value: Option<DOMString>) { - let value = value.unwrap_or(DOMString::new()); + let value = value.unwrap_or_default(); match self.type_id() { NodeTypeId::DocumentFragment | NodeTypeId::Element(..) => { |