diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-04-27 15:25:30 -0500 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-04-27 15:25:30 -0500 |
commit | 8ecb9d681c385995b082d67874fdfa7f1e929e1f (patch) | |
tree | df8b761227a253250df28d689bc47eedc7b0b27b /components/script/dom/node.rs | |
parent | b0a7d1bf865eff7b6ca3bae874004a61c19b3c27 (diff) | |
parent | a270f3e39b97bcb8a5ba47267269e96786adc5ee (diff) | |
download | servo-8ecb9d681c385995b082d67874fdfa7f1e929e1f.tar.gz servo-8ecb9d681c385995b082d67874fdfa7f1e929e1f.zip |
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 -->
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index aaea91a4b15..54f8f812687 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -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(); |