mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
Implement safe rooting strategy via Unrooted, Root, JSRef, and JS.
This commit is contained in:
parent
ffdc3f5b32
commit
d7b96db33c
109 changed files with 1568 additions and 1326 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
use dom::bindings::codegen::InheritTypes::CommentDerived;
|
||||
use dom::bindings::codegen::BindingDeclarations::CommentBinding;
|
||||
use dom::bindings::js::{JS, JSRef, RootCollection};
|
||||
use dom::bindings::js::{JS, JSRef, RootCollection, Unrooted};
|
||||
use dom::bindings::error::Fallible;
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::Document;
|
||||
|
@ -35,12 +35,12 @@ impl Comment {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(text: DOMString, document: &JSRef<Document>) -> JS<Comment> {
|
||||
pub fn new(text: DOMString, document: &JSRef<Document>) -> Unrooted<Comment> {
|
||||
let node = Comment::new_inherited(text, document.unrooted());
|
||||
Node::reflect_node(~node, document, CommentBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: &JSRef<Window>, data: DOMString) -> Fallible<JS<Comment>> {
|
||||
pub fn Constructor(owner: &JSRef<Window>, data: DOMString) -> Fallible<Unrooted<Comment>> {
|
||||
let roots = RootCollection::new();
|
||||
let document = owner.get().Document();
|
||||
let document = document.root(&roots);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue