Introduce RootedVec<JS<T>>::r()

This commit is contained in:
Anthony Ramine 2015-07-23 17:38:49 +02:00
parent 658c3d05ae
commit 389a9ff643
4 changed files with 24 additions and 20 deletions

View file

@ -865,9 +865,9 @@ impl<'a> AttributeHandlers for &'a Element {
fn get_attribute(self, namespace: &Namespace, local_name: &Atom) -> Option<Root<Attr>> {
let mut attributes = RootedVec::new();
self.get_attributes(local_name, &mut attributes);
attributes.iter()
.map(|attr| attr.root())
.find(|attr| attr.r().namespace() == namespace)
attributes.r().iter()
.find(|attr| attr.namespace() == namespace)
.map(|attr| Root::from_ref(*attr))
}
// https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name