mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
This commit is contained in:
parent
577370746e
commit
f87c2a8d76
291 changed files with 1774 additions and 1770 deletions
|
@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::TextBinding::{self, TextMethods};
|
|||
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
||||
use dom::bindings::error::{Error, Fallible};
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::root::{Root, RootedReference};
|
||||
use dom::bindings::root::{DomRoot, RootedReference};
|
||||
use dom::bindings::str::DOMString;
|
||||
use dom::characterdata::CharacterData;
|
||||
use dom::document::Document;
|
||||
|
@ -30,12 +30,12 @@ impl Text {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new(text: DOMString, document: &Document) -> Root<Text> {
|
||||
pub fn new(text: DOMString, document: &Document) -> DomRoot<Text> {
|
||||
Node::reflect_node(box Text::new_inherited(text, document),
|
||||
document, TextBinding::Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(window: &Window, text: DOMString) -> Fallible<Root<Text>> {
|
||||
pub fn Constructor(window: &Window, text: DOMString) -> Fallible<DomRoot<Text>> {
|
||||
let document = window.Document();
|
||||
Ok(Text::new(text, &document))
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ impl Text {
|
|||
impl TextMethods for Text {
|
||||
// https://dom.spec.whatwg.org/#dom-text-splittext
|
||||
// https://dom.spec.whatwg.org/#concept-text-split
|
||||
fn SplitText(&self, offset: u32) -> Fallible<Root<Text>> {
|
||||
fn SplitText(&self, offset: u32) -> Fallible<DomRoot<Text>> {
|
||||
let cdata = self.upcast::<CharacterData>();
|
||||
// Step 1.
|
||||
let length = cdata.Length();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue