aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmllabelelement.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-09-26 01:53:40 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-09-26 09:49:10 +0200
commitf87c2a8d7616112ca924e30292db2d244cf87eec (patch)
tree7344afe7ec0ec1ac7d1d13f5385111ee9c4be332 /components/script/dom/htmllabelelement.rs
parent577370746e2ce3da7fa25a20b8e1bbeed319df65 (diff)
downloadservo-f87c2a8d7616112ca924e30292db2d244cf87eec.tar.gz
servo-f87c2a8d7616112ca924e30292db2d244cf87eec.zip
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.
Diffstat (limited to 'components/script/dom/htmllabelelement.rs')
-rw-r--r--components/script/dom/htmllabelelement.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs
index 0e1e99c3f7b..09397059eab 100644
--- a/components/script/dom/htmllabelelement.rs
+++ b/components/script/dom/htmllabelelement.rs
@@ -7,7 +7,7 @@ use dom::attr::Attr;
use dom::bindings::codegen::Bindings::HTMLLabelElementBinding;
use dom::bindings::codegen::Bindings::HTMLLabelElementBinding::HTMLLabelElementMethods;
use dom::bindings::inheritance::Castable;
-use dom::bindings::root::Root;
+use dom::bindings::root::DomRoot;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element};
@@ -39,7 +39,7 @@ impl HTMLLabelElement {
#[allow(unrooted_must_root)]
pub fn new(local_name: LocalName,
prefix: Option<Prefix>,
- document: &Document) -> Root<HTMLLabelElement> {
+ document: &Document) -> DomRoot<HTMLLabelElement> {
Node::reflect_node(box HTMLLabelElement::new_inherited(local_name, prefix, document),
document,
HTMLLabelElementBinding::Wrap)
@@ -88,7 +88,7 @@ impl Activatable for HTMLLabelElement {
impl HTMLLabelElementMethods for HTMLLabelElement {
// https://html.spec.whatwg.org/multipage/#dom-fae-form
- fn GetForm(&self) -> Option<Root<HTMLFormElement>> {
+ fn GetForm(&self) -> Option<DomRoot<HTMLFormElement>> {
self.form_owner()
}
@@ -99,7 +99,7 @@ impl HTMLLabelElementMethods for HTMLLabelElement {
make_atomic_setter!(SetHtmlFor, "for");
// https://html.spec.whatwg.org/multipage/#dom-label-control
- fn GetControl(&self) -> Option<Root<HTMLElement>> {
+ fn GetControl(&self) -> Option<DomRoot<HTMLElement>> {
if !self.upcast::<Node>().is_in_doc() {
return None;
}
@@ -111,7 +111,7 @@ impl HTMLLabelElementMethods for HTMLLabelElement {
let for_value = for_attr.value();
document_from_node(self).get_element_by_id(for_value.as_atom())
- .and_then(Root::downcast::<HTMLElement>)
+ .and_then(DomRoot::downcast::<HTMLElement>)
.into_iter()
.filter(|e| e.is_labelable_element())
.next()
@@ -142,18 +142,18 @@ impl VirtualMethods for HTMLLabelElement {
}
impl HTMLLabelElement {
- pub fn first_labelable_descendant(&self) -> Option<Root<HTMLElement>> {
+ pub fn first_labelable_descendant(&self) -> Option<DomRoot<HTMLElement>> {
self.upcast::<Node>()
.traverse_preorder()
- .filter_map(Root::downcast::<HTMLElement>)
+ .filter_map(DomRoot::downcast::<HTMLElement>)
.filter(|elem| elem.is_labelable_element())
.next()
}
}
impl FormControl for HTMLLabelElement {
- fn form_owner(&self) -> Option<Root<HTMLFormElement>> {
- self.GetControl().map(Root::upcast::<Element>).and_then(|elem| {
+ fn form_owner(&self) -> Option<DomRoot<HTMLFormElement>> {
+ self.GetControl().map(DomRoot::upcast::<Element>).and_then(|elem| {
elem.as_maybe_form_control().and_then(|control| control.form_owner())
})
}