diff options
author | Keegan McAllister <kmcallister@mozilla.com> | 2013-09-18 14:46:42 -0700 |
---|---|---|
committer | Keegan McAllister <kmcallister@mozilla.com> | 2013-09-18 14:46:42 -0700 |
commit | 68ddc6b4ab653072841489a56421f52dd2c1e87a (patch) | |
tree | 15b39e5cd4347f46580a13244758ff6f770e0b9a /src/components/script/dom/text.rs | |
parent | 5be084a3b6fe2557519d4cd8506efb6b026464d3 (diff) | |
download | servo-68ddc6b4ab653072841489a56421f52dd2c1e87a.tar.gz servo-68ddc6b4ab653072841489a56421f52dd2c1e87a.zip |
Make DOMString an alias for Option<~str>
Fixes #898.
Diffstat (limited to 'src/components/script/dom/text.rs')
-rw-r--r-- | src/components/script/dom/text.rs | 6 |
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 } } |