Fix a race condition that non-preventDefaulted info from the parent process reaches to APZ first in cases where 0-difference touchmove events
Categories
(Core :: Panning and Zooming, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox116 | --- | fixed |
People
(Reporter: hiro, Assigned: hiro)
References
Details
Attachments
(1 external file)
On the main-thread in TouchManager::PreHandleEvent if the incoming touchmove event is same as the previous one we do skip handling the event, which means we do skip sending the event into the content processes. So there's a scenario where preventDefaulted info in the content process is not properly used in APZ. The scenario is; given that there's a touchmove event listener doing preventDefault() in a content
- a touchmove event is delivered to the content process
- while waiting for the response for the touchmove event, there's a new touchmove event equals to the previous one
PreHandleEvent()returns false for the new event, thus we don't send the event to the content- as a result of 3), InputAPZContent::sRoutedToChildProcess doesn't become true since we don't call BrowserParent::SendRealTouchEvent
- thus we fall into this if (mAPZC && !InputAPZContext::WasRoutedToChildProcess() && inputBlockId) branch unfortunately and the info (we didn't handle the event, i.e. eIgnore) is delivered to APZ via this ProcessTouchEvent call
Due to this bug the mochitest I wrote for bug 1719855 sometimes fails. And I noticed that disabling android.touch_resampling.enabled makes the test stable, I suppose touch resampling often generates 0-difference touchmove events.
I don't have any idea to solve this issue, so I am going to set android.touch_resampling.enabled=false for the mochitest in bug 1719855.
Comment 1•3 years ago
|
||
Maybe we can set a new flag, InputAPZContext::WasDropped(), in this case, and add !WasDropped() to the condition for handling the event with the parent-process APZEventState?
| Assignee | ||
Comment 2•3 years ago
|
||
Oh yeah, that will work. Thanks!
I was concerned that even if the event WasDropped() there's a case where we need to send the info to APZ if there's no waiting-response events. But the WasDropped() never becomes true for the first touchmove event, it shouldn't be a matter. APZ will eventually get the proper response.
| Assignee | ||
Comment 3•3 years ago
|
||
And use it to tell whether it's safe to inform the handled result to APZ.
Updated•3 years ago
|
Comment 5•3 years ago
|
||
| bugherder | ||
Description
•