aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/document.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2014-09-17 18:17:19 +0530
committerManish Goregaokar <manishsmail@gmail.com>2014-09-17 18:17:19 +0530
commit11ba79894a13ddaee4bfcdd64d23fd4b54a041f3 (patch)
tree5eac047b9fdc394ff30ce52a6dd888f164c6b629 /components/script/dom/document.rs
parentaa935c7b027bf00bf1f6756b0f5e1f4d0866c964 (diff)
parentf5087e149004e0080a61a2a31d76a5c52ee357e1 (diff)
downloadservo-11ba79894a13ddaee4bfcdd64d23fd4b54a041f3.tar.gz
servo-11ba79894a13ddaee4bfcdd64d23fd4b54a041f3.zip
Merge pull request #3374 from Manishearth/lint_unrooted_jsmanaged
Add lint for ensuring proper rooting of JS<T>; r=jdm
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r--components/script/dom/document.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 8f8f8e5c607..5f2661f9e10 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -69,6 +69,7 @@ pub enum IsHTMLDocument {
}
#[deriving(Encodable)]
+#[must_root]
pub struct Document {
pub node: Node,
reflector_: Reflector,
@@ -309,8 +310,8 @@ impl Document {
}
pub fn new(window: &JSRef<Window>, url: Option<Url>, doctype: IsHTMLDocument, content_type: Option<DOMString>) -> Temporary<Document> {
- let document = Document::new_inherited(window, url, doctype, content_type);
- let document = reflect_dom_object(box document, &Window(*window),
+ let document = reflect_dom_object(box Document::new_inherited(window, url, doctype, content_type),
+ &Window(*window),
DocumentBinding::Wrap).root();
let node: &JSRef<Node> = NodeCast::from_ref(&*document);