Bug 1719855 - Route preventDefaulted touchmove event information to APZ properly...
commit5820e0d891e1143e874e3099d28558d133671592
authorHiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Thu, 22 Jun 2023 03:01:43 +0000 (22 03:01 +0000)
committerHiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Thu, 22 Jun 2023 03:01:43 +0000 (22 03:01 +0000)
tree9e2381de8a9592e0259747909bd005ba527a6404
parentb471f6e843ac66502f866720421da58d703d2988
Bug 1719855 - Route preventDefaulted touchmove event information to APZ properly. r=botond

This change includes three things;

1) Keep two different touch blocks alive during handling a long-tap event,
   one is for the long-tap, the other one is the original block started with
   touchstart.
2) Wait a content response again once after a long-tap event was processed
3) Unconditionally invoke ContentReceivedInputBlockCallback from APZEventState
   for touchmove events so that it will properly route to APZ even if a content
   response for the touchstart has already delivered to APZ.

With these now content responses for `contextmenu` events are handled by the
long-tap block, content responses for touch events are handled by the original
touch block respectively. As a result, `DoLongPressPreventDefaultTest` in
TestGestureDetector.cpp starts processing touch events in APZ thus we observe
a RequestContentRepaint call there, the test content isn't scrolled though. It
will change in the next commit.

Depends on D176479

Differential Revision: https://phabricator.services.mozilla.com/D176480
gfx/layers/apz/src/InputBlockState.cpp
gfx/layers/apz/src/InputBlockState.h
gfx/layers/apz/src/InputQueue.cpp
gfx/layers/apz/src/InputQueue.h
gfx/layers/apz/test/gtest/TestGestureDetector.cpp
gfx/layers/apz/test/mochitest/helper_bug1719855.html
gfx/layers/apz/test/mochitest/helper_bug1719855_pointercancel_on_touchmove_after_contextmenu_prevented.html
gfx/layers/apz/test/mochitest/test_group_touchevents-5.html
gfx/layers/apz/util/APZEventState.cpp