mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
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:
commit
8ecb9d681c
2 changed files with 15 additions and 15 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue