mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Turn on GC all the time. Fix rooting errors during parsing and storing timers. Fix borrow errors during tracing.
This commit is contained in:
parent
4051a8096d
commit
ffdc3f5b32
109 changed files with 1567 additions and 996 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
use dom::bindings::codegen::BindingDeclarations::TextBinding;
|
||||
use dom::bindings::codegen::InheritTypes::TextDerived;
|
||||
use dom::bindings::js::JS;
|
||||
use dom::bindings::js::{JS, JSRef, RootCollection};
|
||||
use dom::bindings::error::Fallible;
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::Document;
|
||||
|
@ -35,13 +35,16 @@ impl Text {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(text: DOMString, document: &JS<Document>) -> JS<Text> {
|
||||
let node = Text::new_inherited(text, document.clone());
|
||||
pub fn new(text: DOMString, document: &JSRef<Document>) -> JS<Text> {
|
||||
let node = Text::new_inherited(text, document.unrooted());
|
||||
Node::reflect_node(~node, document, TextBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(owner: &JS<Window>, text: DOMString) -> Fallible<JS<Text>> {
|
||||
Ok(Text::new(text.clone(), &owner.get().Document()))
|
||||
pub fn Constructor(owner: &JSRef<Window>, text: DOMString) -> Fallible<JS<Text>> {
|
||||
let roots = RootCollection::new();
|
||||
let document = owner.get().Document();
|
||||
let document = document.root(&roots);
|
||||
Ok(Text::new(text.clone(), &document.root_ref()))
|
||||
}
|
||||
|
||||
pub fn SplitText(&self, _offset: u32) -> Fallible<JS<Text>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue