Remove intrinsic Root::r()

This commit is contained in:
Anthony Ramine 2016-05-13 14:20:00 +02:00
parent 51bcf516c8
commit 0b3ab875f4
55 changed files with 275 additions and 310 deletions

View file

@ -49,7 +49,7 @@ impl CollectionFilter for OptionsFilter {
match node.GetParentNode() {
Some(optgroup) =>
optgroup.is::<HTMLOptGroupElement>() && root.is_parent_of(optgroup.r()),
optgroup.is::<HTMLOptGroupElement>() && root.is_parent_of(&optgroup),
None => false,
}
}
@ -97,11 +97,11 @@ impl HTMLSelectElement {
for opt in node.traverse_preorder().filter_map(Root::downcast::<HTMLOptionElement>) {
if opt.Selected() {
opt.set_selectedness(false);
last_selected = Some(Root::from_ref(opt.r()));
last_selected = Some(Root::from_ref(&opt));
}
let element = opt.upcast::<Element>();
if first_enabled.is_none() && !element.disabled_state() {
first_enabled = Some(Root::from_ref(opt.r()));
first_enabled = Some(Root::from_ref(&opt));
}
}
@ -164,7 +164,7 @@ impl HTMLSelectElementMethods for HTMLSelectElement {
// https://html.spec.whatwg.org/multipage/#dom-cva-validity
fn Validity(&self) -> Root<ValidityState> {
let window = window_from_node(self);
ValidityState::new(window.r(), self.upcast())
ValidityState::new(&window, self.upcast())
}
// Note: this function currently only exists for union.html.
@ -219,8 +219,8 @@ impl HTMLSelectElementMethods for HTMLSelectElement {
fn Options(&self) -> Root<HTMLOptionsCollection> {
self.options.or_init(|| {
let window = window_from_node(self);
HTMLOptionsCollection::new(window.r(),
self.upcast(), box OptionsFilter)
HTMLOptionsCollection::new(
&window, self.upcast(), box OptionsFilter)
})
}