mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Hold a Temporary in AncestorIterator
This commit is contained in:
parent
6a6ecb9afa
commit
bf7c791e3a
10 changed files with 91 additions and 63 deletions
|
@ -31,7 +31,8 @@ pub fn dispatch_event<'a, 'b>(target: JSRef<'a, EventTarget>,
|
|||
let mut chain: RootedVec<JS<EventTarget>> = RootedVec::new();
|
||||
if let Some(target_node) = NodeCast::to_ref(target) {
|
||||
for ancestor in target_node.ancestors() {
|
||||
let ancestor_target: JSRef<EventTarget> = EventTargetCast::from_ref(ancestor);
|
||||
let ancestor = ancestor.root();
|
||||
let ancestor_target = EventTargetCast::from_ref(ancestor.r());
|
||||
chain.push(JS::from_rooted(ancestor_target))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue