Auto merge of #5692 - pgonda:get_attributes-memory-safety, r=jdm

Changes Element::get_attributes to use a `&mut Rooted<JS<Attr>>` param instead of returning a `Vec<Temporary<Attr>>`, fixes  #5684.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5692)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-04-27 15:25:30 -05:00
commit 8ecb9d681c
2 changed files with 15 additions and 15 deletions

View file

@ -2525,9 +2525,9 @@ impl<'a> style::node::TNode<'a> for JSRef<'a, Node> {
})
},
NamespaceConstraint::Any => {
self.as_element().get_attributes(local_name).into_iter()
.map(|attr| attr.root())
.any(|attr| {
let mut attributes: RootedVec<JS<Attr>> = RootedVec::new();
self.as_element().get_attributes(local_name, &mut attributes);
attributes.iter().map(|attr| attr.root()).any(|attr| {
// FIXME(https://github.com/rust-lang/rust/issues/23338)
let attr = attr.r();
let value = attr.value();