mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Replace Root::deref() calls by Root::r() calls where possible.
This changes those calls that were already sound.
This commit is contained in:
parent
c9f26dfd59
commit
1dad710063
61 changed files with 479 additions and 471 deletions
|
@ -181,8 +181,8 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
|
|||
CollectionTypeId::Static(ref elems) => elems.len() as u32,
|
||||
CollectionTypeId::Live(ref root, ref filter) => {
|
||||
let root = root.root();
|
||||
HTMLCollection::traverse(*root)
|
||||
.filter(|element| filter.filter(*element, *root))
|
||||
HTMLCollection::traverse(root.r())
|
||||
.filter(|element| filter.filter(*element, root.r()))
|
||||
.count() as u32
|
||||
}
|
||||
}
|
||||
|
@ -197,8 +197,8 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
|
|||
.map(|elem| Temporary::new(elem.clone())),
|
||||
CollectionTypeId::Live(ref root, ref filter) => {
|
||||
let root = root.root();
|
||||
HTMLCollection::traverse(*root)
|
||||
.filter(|element| filter.filter(*element, *root))
|
||||
HTMLCollection::traverse(root.r())
|
||||
.filter(|element| filter.filter(*element, root.r()))
|
||||
.nth(index as uint)
|
||||
.clone()
|
||||
.map(Temporary::from_rooted)
|
||||
|
@ -218,13 +218,13 @@ impl<'a> HTMLCollectionMethods for JSRef<'a, HTMLCollection> {
|
|||
CollectionTypeId::Static(ref elems) => elems.iter()
|
||||
.map(|elem| elem.root())
|
||||
.find(|elem| {
|
||||
elem.get_string_attribute(&atom!("name")) == key ||
|
||||
elem.get_string_attribute(&atom!("id")) == key })
|
||||
.map(|maybe_elem| Temporary::from_rooted(*maybe_elem)),
|
||||
elem.r().get_string_attribute(&atom!("name")) == key ||
|
||||
elem.r().get_string_attribute(&atom!("id")) == key })
|
||||
.map(|maybe_elem| Temporary::from_rooted(maybe_elem.r())),
|
||||
CollectionTypeId::Live(ref root, ref filter) => {
|
||||
let root = root.root();
|
||||
HTMLCollection::traverse(*root)
|
||||
.filter(|element| filter.filter(*element, *root))
|
||||
HTMLCollection::traverse(root.r())
|
||||
.filter(|element| filter.filter(*element, root.r()))
|
||||
.find(|elem| {
|
||||
elem.get_string_attribute(&atom!("name")) == key ||
|
||||
elem.get_string_attribute(&atom!("id")) == key })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue