aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing/touch.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fixed the crash issue when the openharmony web component is adapted. (#36229)Bi Fuguo2025-03-311-1/+2
| | | Signed-off-by: kongbai1996 <1782765876@qq.com>
* Fixed an incorrect touchmove event triggered when the second finger is ↵Bi Fuguo2025-03-291-4/+1
| | | | | pressed. (#36218) Signed-off-by: kongbai1996 <1782765876@qq.com>
* Migrate to the 2024 edition (#35755)Simon Wülker2025-03-131-5/+1
| | | | | | | | | | | | | | | | | | | | | | * Migrate to 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Allow unsafe_op_in_unsafe_fn lint This lint warns by default in the 2024 edition, but is *way* too noisy for servo. We might enable it in the future, but not now. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Compile using the 2024 edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Optimize IPC for non-cancelable touch events (#35785)Bi Fuguo2025-03-041-0/+4
| | | | | | | | | | | | | | * The cancelable feature is optimized. If the cancelable feature is a non-cancelable feature, no message is sent back to the Compositor. Add a warning log when prevent TouchsequenceInfo cannot be found. Signed-off-by: kongbai1996 <1782765876@qq.com> * fix Clippy Error Reported in the Pipeline. Signed-off-by: kongbai1996 <1782765876@qq.com> --------- Signed-off-by: kongbai1996 <1782765876@qq.com>
* Fix the problem that touchmove crashes occasionally. Fix crash when multiple ↵Bi Fuguo2025-03-031-30/+28
| | | | | | | | | | | | | | | | | | | | | | touch cancels occur (#35763) * Fix the problem that touchmove crashes occasionally. Check whether touchSequenceInfo exists when touch_sequence_map is modified in on_touch_event_processed. Signed-off-by: kongbai1996 <1782765876@qq.com> * Remove outdated todo. We already transition to Finished in `on_touch_cancel` in the Touch handler, so we don't need any logic in the event handler. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: kongbai1996 <1782765876@qq.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Touch handler: Fix race condition and rate-limit move events (#35537)Bi Fuguo2025-02-251-119/+420
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * TouchSequenceInfo is added to store information about a touch sequence. For details about TouchSequenceInfo, see the code comments. The handling_touch_move attribute is added to the TouchHandler, indicating that the script is processing the touch move event. When handling_touch_move is set to true, the touch move event does not need to be sent to the script thread. Signed-off-by: kongbai1996 <1782765876@qq.com> * move touch state, active_touch_point and handling_touch_move to TouchSequenceInfo form TouchHandler. remove TouchSequenceInfo end_sequence property, add Finished state mark sequence end. if preventDefault on touchup, do not prevent Fling. Signed-off-by: kongbai1996 <1782765876@qq.com> * Refactor Touchhandler - Add a newtype wrapper for the TouchSequenceId - Move more state back into the TouchSequenceState - Rename TouchAction to TouchMoveAction, since it only covers immediate actions now. Everything else is handled via state, since it needs to wait on the handler. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix test-tidy Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix clippy missing-default lint Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix remaining clippy lints Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Remove accidental committed test file Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Remove wrong todo comment (move events that are sent to script are just raw touchpoints, no merging needed) Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Fix preventdefault after long touch_down handler Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> --------- Signed-off-by: kongbai1996 <1782765876@qq.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* implement Touchevent prevent default behavior (#35031)Bi Fuguo2025-02-171-136/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* libservo: Stop using `script_traits` in the embedding layer (#35185)Martin Robinson2025-01-281-1/+2
| | | | | | | | | | | | | | | Many types used directly in the `libservo` API are in the `script_traits` crate, which was created to break circular dependencies. Move all API exposed types to `embedder_traits` which now contains types exposed via the `libservo` embedding API. Also expose these at the root of the `libservo` `servo` crate so that the API won't break when they move around in the future. The idea with `embedder_traits` in the future is that it contains types that are available throughout servo because they are used in the embedding API and thus should have minimal dependencies on other Servo crates (a bit like `base`). Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* fix click event when long time in touchstart (#34812)Bi Fuguo2025-01-141-1/+8
| | | | | | | | | | | | | | | * fix click event when long time in touchstart Signed-off-by: kongbai1996 <1782765876@qq.com> Signed-off-by: Bi Fuguo <1782765876@qq.com> * update TouchAction::Click condition Signed-off-by: Bi Fuguo <1782765876@qq.com> --------- Signed-off-by: kongbai1996 <1782765876@qq.com> Signed-off-by: Bi Fuguo <1782765876@qq.com>
* Use `webrender_api::units::DevicePixel` rather than ↵Nico Burns2024-11-251-2/+1
| | | | | | | | | | | | | | | `style_traits::DevicePixel` unless interfacing with Stylo (#34353) * Use webrender_api::units::DevicePixel rather than style_traits::DevicePixel unless interfacing with Stylo Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix OpenHarmony build Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
* Add simple fling implementation (#33219)Jonathan Schwender2024-11-101-18/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add simple fling implementation Add a simple fling implementation, which depends on a refresh tick from the embedder. Currently this refresh tick is only implemented for OpenHarmony (using the vsync signal). The fling implementation is very simple, without any fancy things like acceleration. This can be improved in the future. Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Multiply initial velocity with 2 This makes the experience much more snappy. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * address review comments Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Rename constants and add todo Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * fmt Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Add a few periods to make comments consistent Signed-off-by: Martin Robinson <mrobinson@igalia.com> --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix assorted warnings in `components/` (#31628)eri2024-03-131-4/+1
| | | | | | | * clippy: fix assorted warnings in `components/` * fix: new and default * fix: review comments
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-1/+2
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-0/+1
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Update euclid.Emilio Cobos Álvarez2019-07-231-20/+11
| | | | | | | | There are a few canvas2d-related dependencies that haven't updated, but they only use euclid internally so that's not blocking landing the rest of the changes. Given the size of this patch, I think it's useful to get this landed as-is.
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Reorder importsPyfisch2018-11-061-2/+2
|
* Format component compositing #21373kingdido9992018-08-311-31/+38
|
* Change debug assertions to specific onesjanczer2018-02-071-1/+1
|
* Update euclid, azure, skia, offscreen_gl_context, plane-split, webrenderSimon Sapin2017-12-081-2/+2
|
* Fixed scaling artefacts in paint worklets caused by zoom and hidpi.Alan Jeffrey2017-07-201-1/+2
|
* Bump euclid to 0.14.Nicolas Silva2017-06-141-8/+6
|
* Rename ScreenPx to DeviceIndependentPixel.Glenn Watson2017-02-221-2/+1
|
* Move DevicePixel to script_traits.Ms2ger2017-01-111-2/+1
|
* Indicate items in doc comments as code-like.Corey Farwell2016-11-081-1/+1
|
* Remove old rendering backend.Glenn Watson2016-10-181-1/+1
| | | | | | | | | | | | | | This removes paint threads, rust-layers dependency, and changes optional webrender types to be required. The use_webrender option has been removed, however I've left the "-w" command line option in place so that wpt runner can continue to pass that. Once it's removed from there we can also remove the -w option. Once this stage is complete, it should be fine to change the display list building code to generate webrender display lists directly and avoid the conversion step.
* Update to euclid 0.8Martin Robinson2016-08-121-15/+13
|
* Fix a bunch of clippy lintsJohannes Linke2016-01-021-4/+3
|
* Moved ScriptToCompositorMsg enum and EventResult enum to script_traitsBeomjin Kim2015-12-201-2/+1
| | | | | Moved ScriptToCompositorMsg enum and EventResult enum to script_traits resolving issue #8835.
* Refactor touch handling and add pinch zoom gestureMatt Brubeck2015-12-161-0/+237