Optimize IPC for non-cancelable touch events (#35785)

* 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>
This commit is contained in:
Bi Fuguo 2025-03-04 14:46:25 +08:00 committed by GitHub
parent ff5683680f
commit f594691af9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View file

@ -1095,7 +1095,9 @@ impl ScriptThread {
InputEvent::Touch(touch_event) => {
let touch_result =
document.handle_touch_event(touch_event, event.hit_test_result, can_gc);
if let TouchEventResult::Processed(handled) = touch_result {
if let (TouchEventResult::Processed(handled), true) =
(touch_result, touch_event.is_cancelable())
{
let sequence_id = touch_event.expect_sequence_id();
let result = if handled {
script_traits::TouchEventResult::DefaultAllowed(