aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/node.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2015-11-13 04:51:32 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2015-11-13 04:51:32 +0530
commit1720595a85ff0a593994fed1d086288746c56aa3 (patch)
treeef1a944f0733dd77cd8786357bf5dbe2c0efa8fd /components/script/dom/node.rs
parentc44c73aa00ced6235266bd692833e22018f31138 (diff)
parent00fa3b2f85fde78f7af8e4636ee7b55a9aecc28d (diff)
downloadservo-1720595a85ff0a593994fed1d086288746c56aa3.tar.gz
servo-1720595a85ff0a593994fed1d086288746c56aa3.zip
Auto merge of #8479 - frewsxcv:domstring-default, r=Ms2ger
Implement Default trait for DOMString <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8479) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r--components/script/dom/node.rs6
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(..) => {