aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/comment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/comment.rs')
-rw-r--r--components/script/dom/comment.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/dom/comment.rs b/components/script/dom/comment.rs
index e50b24b2a58..dd070df87ac 100644
--- a/components/script/dom/comment.rs
+++ b/components/script/dom/comment.rs
@@ -17,6 +17,7 @@ use servo_util::str::DOMString;
/// An HTML comment.
#[deriving(Encodable)]
+#[must_root]
pub struct Comment {
pub characterdata: CharacterData,
}
@@ -35,8 +36,8 @@ impl Comment {
}
pub fn new(text: DOMString, document: &JSRef<Document>) -> Temporary<Comment> {
- let node = Comment::new_inherited(text, document);
- Node::reflect_node(box node, document, CommentBinding::Wrap)
+ Node::reflect_node(box Comment::new_inherited(text, document),
+ document, CommentBinding::Wrap)
}
pub fn Constructor(global: &GlobalRef, data: DOMString) -> Fallible<Temporary<Comment>> {