aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/comment.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2023-05-28 22:43:55 -0400
committerJosh Matthews <josh@joshmatthews.net>2023-05-28 23:23:12 -0400
commitdbff26bce05d404027ef5bbfd85fb5995e4726bc (patch)
tree6ebb631eef396c2f387fe8269b0d59bde0dccae2 /components/script/dom/comment.rs
parentd9600ff50f3c1bdd8c44e2dfc15a18416d80cb82 (diff)
downloadservo-dbff26bce05d404027ef5bbfd85fb5995e4726bc.tar.gz
servo-dbff26bce05d404027ef5bbfd85fb5995e4726bc.zip
Support arbitrary protos when wrapping DOM objects with constructors.
Diffstat (limited to 'components/script/dom/comment.rs')
-rw-r--r--components/script/dom/comment.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/comment.rs b/components/script/dom/comment.rs
index d87f4d77094..96df242a5df 100644
--- a/components/script/dom/comment.rs
+++ b/components/script/dom/comment.rs
@@ -11,6 +11,7 @@ use crate::dom::document::Document;
use crate::dom::node::Node;
use crate::dom::window::Window;
use dom_struct::dom_struct;
+use js::rust::HandleObject;
/// An HTML comment.
#[dom_struct]
@@ -25,13 +26,13 @@ impl Comment {
}
}
- pub fn new(text: DOMString, document: &Document) -> DomRoot<Comment> {
- Node::reflect_node(Box::new(Comment::new_inherited(text, document)), document)
+ pub fn new(text: DOMString, document: &Document, proto: Option<HandleObject>) -> DomRoot<Comment> {
+ Node::reflect_node_with_proto(Box::new(Comment::new_inherited(text, document)), document, proto)
}
#[allow(non_snake_case)]
- pub fn Constructor(window: &Window, data: DOMString) -> Fallible<DomRoot<Comment>> {
+ pub fn Constructor(window: &Window, proto: Option<HandleObject>, data: DOMString) -> Fallible<DomRoot<Comment>> {
let document = window.Document();
- Ok(Comment::new(data, &document))
+ Ok(Comment::new(data, &document, proto))
}
}