mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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
|
@ -4,7 +4,7 @@
|
|||
|
||||
use dom::bindings::error::{report_pending_exception, throw_dom_exception};
|
||||
use dom::bindings::reflector::DomObject;
|
||||
use dom::bindings::root::Root;
|
||||
use dom::bindings::root::DomRoot;
|
||||
use dom::customelementregistry::{is_valid_custom_element_name, upgrade_element};
|
||||
use dom::document::Document;
|
||||
use dom::element::{CustomElementCreationMode, CustomElementState, Element, ElementCreator};
|
||||
|
@ -87,17 +87,17 @@ use servo_config::prefs::PREFS;
|
|||
fn create_svg_element(name: QualName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document)
|
||||
-> Root<Element> {
|
||||
-> DomRoot<Element> {
|
||||
assert!(name.ns == ns!(svg));
|
||||
|
||||
macro_rules! make(
|
||||
($ctor:ident) => ({
|
||||
let obj = $ctor::new(name.local, prefix, document);
|
||||
Root::upcast(obj)
|
||||
DomRoot::upcast(obj)
|
||||
});
|
||||
($ctor:ident, $($arg:expr),+) => ({
|
||||
let obj = $ctor::new(name.local, prefix, document, $($arg),+);
|
||||
Root::upcast(obj)
|
||||
DomRoot::upcast(obj)
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -119,7 +119,7 @@ fn create_html_element(name: QualName,
|
|||
document: &Document,
|
||||
creator: ElementCreator,
|
||||
mode: CustomElementCreationMode)
|
||||
-> Root<Element> {
|
||||
-> DomRoot<Element> {
|
||||
assert!(name.ns == ns!(html));
|
||||
|
||||
// Step 4
|
||||
|
@ -129,7 +129,7 @@ fn create_html_element(name: QualName,
|
|||
if definition.is_autonomous() {
|
||||
match mode {
|
||||
CustomElementCreationMode::Asynchronous => {
|
||||
let result = Root::upcast::<Element>(
|
||||
let result = DomRoot::upcast::<Element>(
|
||||
HTMLElement::new(name.local.clone(), prefix.clone(), document));
|
||||
result.set_custom_element_state(CustomElementState::Undefined);
|
||||
ScriptThread::enqueue_upgrade_reaction(&*result, definition);
|
||||
|
@ -155,7 +155,7 @@ fn create_html_element(name: QualName,
|
|||
}
|
||||
|
||||
// Step 6.1.2
|
||||
let element = Root::upcast::<Element>(
|
||||
let element = DomRoot::upcast::<Element>(
|
||||
HTMLUnknownElement::new(local_name, prefix, document));
|
||||
element.set_custom_element_state(CustomElementState::Failed);
|
||||
element
|
||||
|
@ -195,17 +195,17 @@ pub fn create_native_html_element(name: QualName,
|
|||
prefix: Option<Prefix>,
|
||||
document: &Document,
|
||||
creator: ElementCreator)
|
||||
-> Root<Element> {
|
||||
-> DomRoot<Element> {
|
||||
assert!(name.ns == ns!(html));
|
||||
|
||||
macro_rules! make(
|
||||
($ctor:ident) => ({
|
||||
let obj = $ctor::new(name.local, prefix, document);
|
||||
Root::upcast(obj)
|
||||
DomRoot::upcast(obj)
|
||||
});
|
||||
($ctor:ident, $($arg:expr),+) => ({
|
||||
let obj = $ctor::new(name.local, prefix, document, $($arg),+);
|
||||
Root::upcast(obj)
|
||||
DomRoot::upcast(obj)
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -364,7 +364,7 @@ pub fn create_element(name: QualName,
|
|||
document: &Document,
|
||||
creator: ElementCreator,
|
||||
mode: CustomElementCreationMode)
|
||||
-> Root<Element> {
|
||||
-> DomRoot<Element> {
|
||||
let prefix = name.prefix.clone();
|
||||
match name.ns {
|
||||
ns!(html) => create_html_element(name, prefix, is, document, creator, mode),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue