Bug 270516

Summary: REGRESSION(263237@main): [WPE] Identifiers for touch points are not constant in multi touch
Product: WebKit Reporter: gebausim
Component: WPE WebKitAssignee: Carlos Alberto Lopez Perez <clopez>
Status: NEW ---    
Severity: Normal CC: aperez, bst, bugs-noreply, clopez, mcatanzaro
Priority: P2    
Version: WebKit Local Build   
Hardware: Other   
OS: Linux   
See Also: https://bugs.webkit.org/show_bug.cgi?id=214865
https://github.com/Igalia/cog/issues/698
https://bugs.webkit.org/show_bug.cgi?id=276608
Attachments:
Description Flags
Showcase none

Description gebausim 2024-03-05 06:27:43 PST
Created attachment 470180 [details]
Showcase

Propably the best way to showcase this is via https://people.igalia.com/clopez/wkbug/pointer-events/paint.html page (as shown in the attached screenshot). Reproduced by simultaneously doing the snake move with one finger on the right and multiple lines with the other hand. What is expected is the first touch not to be influenced by the other ones and remain the same color/id (red) all the way.

Same issue can also be observed in https://patrickhlauke.github.io/touch/tracker/multi-touch-tracker-index.html page. Where the identifier numbers rapidly change between all the currently active touch ids.

Happens since: https://github.com/WebKit/WebKit/commit/84e4a4ae1e8936da66c30862be411246417d44fd

The effects of this are that any javascript pan or zoom gestures don't work properly, can be tested on https://elmarquis.github.io/Leaflet.GestureHandling/examples/. Zooming on the map is just very funky.
Comment 1 gebausim 2024-03-08 02:38:45 PST
Actually https://github.com/WebKit/WebKit/commit/057b735cbf912f620273106541f2196191c5aa53 seems to be the cause as simply reverting this fixes the issues with maps etc.
Comment 2 Adrian Perez 2024-03-27 02:01:20 PDT
(In reply to gebausim from comment #1)
> Actually
> https://github.com/WebKit/WebKit/commit/
> 057b735cbf912f620273106541f2196191c5aa53 seems to be the cause as simply
> reverting this fixes the issues with maps etc.

I see you have added the “[Gtk]” tag in the bug summary, but this commit
only affects WPE. Can you confirm that the regression affects the WPE port?
Or does it also affect the GTK port (so: both affected) but reverting that
commit fixes WPE (and GTK still would have issues)?

At any rate, thanks for the bug report and the investigation to find the
possible cause.
Comment 3 gebausim 2024-03-27 04:34:55 PDT
(In reply to Adrian Perez from comment #2)
> (In reply to gebausim from comment #1)
> > Actually
> > https://github.com/WebKit/WebKit/commit/
> > 057b735cbf912f620273106541f2196191c5aa53 seems to be the cause as simply
> > reverting this fixes the issues with maps etc.
> 
> I see you have added the “[Gtk]” tag in the bug summary, but this commit
> only affects WPE. Can you confirm that the regression affects the WPE port?
> Or does it also affect the GTK port (so: both affected) but reverting that
> commit fixes WPE (and GTK still would have issues)?
> 
> At any rate, thanks for the bug report and the investigation to find the
> possible cause.

Someone else added the added the GTK tag, Initially I was testing WPE only. 

I compiled the latest WPEWebKit from main(8603570132a8) and the issue is still there and also cog constantly keeps crashing on touch_on_up assert.

I tried Epiphany and it's also broken although in a different way. On https://elmarquis.github.io/Leaflet.GestureHandling/examples/ zooming on the map without mouse is impossible. I can't get https://people.igalia.com/clopez/wkbug/pointer-events/paint.html to work at all, but on https://touchscreentest.com/ the issue with one touch color influencing other can be seen.

Reverting the commit does fix the issues, but also restores the touch IDs starting from 0 with every new touch group, not sure if any websites rely on the proper behavior. I could not find any that it would break.
Comment 4 Adrian Perez 2024-03-27 04:58:54 PDT
Great, thanks for confirming. I have also added the [WPE] tag accordingly.
Comment 5 gebausim 2024-03-27 05:05:11 PDT
To add a bit more info on the GTK side, I compiled WebKitGTK main(8603570132a8) and reverting the offending commit does nothing. Same odd behavior as in my systems Epiphany.
Comment 6 Adrian Perez 2024-03-27 06:26:28 PDT
(In reply to gebausim from comment #5)
> To add a bit more info on the GTK side, I compiled WebKitGTK
> main(8603570132a8) and reverting the offending commit does nothing. Same odd
> behavior as in my systems Epiphany.

That's what I would expect, given that the patch that caused the regression
for WPE (263969@main) does not touch anything used by the GTK port. Probably
the issue with GTK is a different one that has similar symptoms.

Thanks for commenting!
Comment 7 Carlos Alberto Lopez Perez 2024-07-17 15:27:24 PDT
Pull request: https://github.com/WebKit/WebKit/pull/30926