servo/components/shared
Bi Fuguo 3fe42a0b5a
implement Touchevent prevent default behavior (#35031)
* implement Touchevent prevent default behavior

* The status change logic of the `TouchHandler` is changed.
> The `WaitingForScript` state is canceled. TouchAction can be identified
  based on the current touch type and numbers if touch points.
* Sends current event to script thread along with recognized `TouchAction`.
> After dispatch event, script thread sends a `TouchEventProcess(EventResult)`
  message to main thread. If the event is set to `DefaultAllowed`, the
  corresponding `TouchAction` information is added.
* After receiving `DefaultAllowed(TouchAction)` message, main thread executes corresponding action.
> `DefaultPrevented(TouchEventType)` is received. Use `prevent_click` to mark
  that the default `Click` is blocked, and `prevent_move` to mark that the
  default `Scroll` and `Zoom` are blocked. In this way, all TouchActions
  implement preventDefault.
Signed-off-by: Bi Fuguo <1782765876@qq.com>

* fix some suggestions

* support preventDefault fling
* move `TouchAction` to share touch directory
* check preventDefault everytime when touch
* fix zoom ineffective

Signed-off-by: Bi Fuguo <1782765876@qq.com>

* fix some suggestions

rename on_event_processed to  on_touch_event_processed
clear unused features

Signed-off-by: Bi Fuguo <1782765876@qq.com>

* Optimizes pan performance by continuously sliding without waiting for the eventhandler.

Signed-off-by: kongbai1996 <1782765876@qq.com>

* resolve conflict

Signed-off-by: kongbai1996 <1782765876@qq.com>

---------

Signed-off-by: Bi Fuguo <1782765876@qq.com>
Signed-off-by: kongbai1996 <1782765876@qq.com>
2025-02-17 10:50:04 +00:00
..
background_hang_monitor libservo: Expose a single InputEvent type and pass it to script (#35430) 2025-02-12 17:07:15 +00:00
base deps: Upgrade to webrender@0.66 (#35325) 2025-02-07 11:57:26 +00:00
bluetooth Include WebViewId into EmbedderMsg variants where possible (#35211) 2025-01-30 11:15:35 +00:00
canvas Use surfman with glow bindings (take II) (#35422) 2025-02-13 07:26:38 +00:00
compositing libservo: Expose a single InputEvent type and pass it to script (#35430) 2025-02-12 17:07:15 +00:00
devtools Inform the devtools about shadow roots on a node (#35294) 2025-02-05 13:16:36 +00:00
embedder implement Touchevent prevent default behavior (#35031) 2025-02-17 10:50:04 +00:00
fonts Remove some unused dependencies (#34355) 2024-11-25 10:29:58 +00:00
net deps: Remove some unused Cargo.toml (#35466) 2025-02-14 15:33:14 +00:00
profile libservo: Expose a single InputEvent type and pass it to script (#35430) 2025-02-12 17:07:15 +00:00
script implement Touchevent prevent default behavior (#35031) 2025-02-17 10:50:04 +00:00
script_layout deps: Remove some unused Cargo.toml (#35466) 2025-02-14 15:33:14 +00:00
webrender libservo: Expose an OffscreenRenderingContext and use it for servoshell (#35465) 2025-02-17 08:35:05 +00:00
webxr deps: Remove some unused Cargo.toml (#35466) 2025-02-14 15:33:14 +00:00