mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
add cancelable
property to the TouchEvent
(#35713)
* add `cancelable` property to the `TouchEvent` set cancellable = false when sending move events to script, if the first touch_move event did not cancel it Signed-off-by: kongbai1996 <1782765876@qq.com> * modified review commentss Signed-off-by: kongbai1996 <1782765876@qq.com> --------- Signed-off-by: kongbai1996 <1782765876@qq.com>
This commit is contained in:
parent
67bd557f30
commit
929f87f598
3 changed files with 17 additions and 2 deletions
|
@ -1396,7 +1396,7 @@ impl IOCompositor {
|
|||
self.send_touch_event(event);
|
||||
}
|
||||
|
||||
fn on_touch_move(&mut self, event: TouchEvent) {
|
||||
fn on_touch_move(&mut self, mut event: TouchEvent) {
|
||||
let action: TouchMoveAction = self.touch_handler.on_touch_move(event.id, event.point);
|
||||
if TouchMoveAction::NoAction != action {
|
||||
// if first move processed and allowed, we directly process the move event,
|
||||
|
@ -1405,6 +1405,8 @@ impl IOCompositor {
|
|||
.touch_handler
|
||||
.move_allowed(self.touch_handler.current_sequence_id)
|
||||
{
|
||||
// https://w3c.github.io/touch-events/#cancelability
|
||||
event.disable_cancelable();
|
||||
match action {
|
||||
TouchMoveAction::Scroll(delta, point) => self.on_scroll_window_event(
|
||||
ScrollLocation::Delta(LayoutVector2D::from_untyped(delta.to_untyped())),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue