aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/text.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/dom/text.rs')
-rw-r--r--src/components/script/dom/text.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/script/dom/text.rs b/src/components/script/dom/text.rs
index 456e1084538..5ceedbe7fc0 100644
--- a/src/components/script/dom/text.rs
+++ b/src/components/script/dom/text.rs
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use dom::bindings::utils::{DOMString, ErrorResult, null_string};
+use dom::bindings::utils::{DOMString, ErrorResult, null_str_as_empty};
use dom::characterdata::CharacterData;
use dom::node::{AbstractNode, ScriptView, Node, TextNodeTypeId};
use dom::window::Window;
@@ -22,7 +22,7 @@ impl Text {
pub fn Constructor(owner: @mut Window, text: &DOMString, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
let cx = owner.page.js_info.get_ref().js_compartment.cx.ptr;
- unsafe { Node::as_abstract_node(cx, @Text::new(text.to_str())) }
+ unsafe { Node::as_abstract_node(cx, @Text::new(null_str_as_empty(text))) }
}
pub fn SplitText(&self, _offset: u32, _rv: &mut ErrorResult) -> AbstractNode<ScriptView> {
@@ -30,6 +30,6 @@ impl Text {
}
pub fn GetWholeText(&self, _rv: &mut ErrorResult) -> DOMString {
- null_string
+ None
}
}