Remove a use of rooted_vec in Document::handle_touch_event

This commit is contained in:
Anthony Ramine 2018-02-21 22:54:12 +01:00
parent 4d7383f4f3
commit 3d46f6749d

View file

@ -1176,29 +1176,29 @@ impl Document {
} }
} }
rooted_vec!(let mut touches);
touches.extend(self.active_touch_points.borrow().iter().cloned());
rooted_vec!(let mut target_touches); rooted_vec!(let mut target_touches);
target_touches.extend(self.active_touch_points let touches = {
.borrow() let touches = self.active_touch_points.borrow();
.iter() target_touches.extend(touches.iter().filter(|t| t.Target() == target).cloned());
.filter(|t| t.Target() == target) TouchList::new(window, touches.r())
.cloned()); };
let event = TouchEvent::new(window, let event = TouchEvent::new(
window,
DOMString::from(event_name), DOMString::from(event_name),
EventBubbles::Bubbles, EventBubbles::Bubbles,
EventCancelable::Cancelable, EventCancelable::Cancelable,
Some(window), Some(window),
0i32, 0i32,
&TouchList::new(window, touches.r()), &touches,
&TouchList::new(window, ref_slice(&&*touch)), &TouchList::new(window, ref_slice(&&*touch)),
&TouchList::new(window, target_touches.r()), &TouchList::new(window, target_touches.r()),
// FIXME: modifier keys // FIXME: modifier keys
false, false,
false, false,
false, false,
false); false,
);
let event = event.upcast::<Event>(); let event = event.upcast::<Event>();
let result = event.fire(&target); let result = event.fire(&target);