summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/util/APZEventState.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
commitdef92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch)
tree2ef34b9ad8bb9a9220e05d60352558b15f513894 /gfx/layers/apz/util/APZEventState.cpp
parentAdding debian version 125.0.3-1. (diff)
downloadfirefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz
firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/layers/apz/util/APZEventState.cpp')
-rw-r--r--gfx/layers/apz/util/APZEventState.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/gfx/layers/apz/util/APZEventState.cpp b/gfx/layers/apz/util/APZEventState.cpp
index 5db6a08429..c205b09ca2 100644
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.cpp
@@ -27,6 +27,7 @@
#include "mozilla/dom/BrowserChild.h"
#include "mozilla/dom/MouseEventBinding.h"
#include "mozilla/layers/APZCCallbackHelper.h"
+#include "mozilla/layers/APZUtils.h"
#include "mozilla/layers/IAPZCTreeManager.h"
#include "mozilla/widget/nsAutoRollup.h"
#include "nsCOMPtr.h"
@@ -101,7 +102,7 @@ APZEventState::APZEventState(nsIWidget* aWidget,
mContentReceivedInputBlockCallback(std::move(aCallback)),
mPendingTouchPreventedResponse(false),
mPendingTouchPreventedBlockId(0),
- mEndTouchIsClick(false),
+ mEndTouchState(apz::SingleTapState::NotClick),
mFirstTouchCancelled(false),
mTouchEndCancelled(false),
mReceivedNonTouchStart(false),
@@ -349,11 +350,13 @@ void APZEventState::ProcessTouchEvent(
case eTouchEnd:
if (isTouchPrevented) {
mTouchEndCancelled = true;
- mEndTouchIsClick = false;
+ mEndTouchState = apz::SingleTapState::NotClick;
}
[[fallthrough]];
case eTouchCancel:
- mActiveElementManager->HandleTouchEndEvent(mEndTouchIsClick);
+ if (mActiveElementManager->HandleTouchEndEvent(mEndTouchState)) {
+ mEndTouchState = apz::SingleTapState::NotClick;
+ }
[[fallthrough]];
case eTouchMove: {
if (!mReceivedNonTouchStart) {
@@ -515,13 +518,13 @@ void APZEventState::ProcessAPZStateChange(ViewID aViewId,
break;
}
case APZStateChange::eStartTouch: {
- bool canBePan = aArg;
- mActiveElementManager->HandleTouchStart(canBePan);
+ bool canBePanOrZoom = aArg;
+ mActiveElementManager->HandleTouchStart(canBePanOrZoom);
// If this is a non-scrollable content, set a timer for the amount of
// time specified by ui.touch_activation.duration_ms to clear the
// active element state.
- APZES_LOG("%s: can-be-pan=%d", __FUNCTION__, aArg);
- if (!canBePan) {
+ APZES_LOG("%s: can-be-pan-or-zoom=%d", __FUNCTION__, aArg);
+ if (!canBePanOrZoom) {
MOZ_ASSERT(aInputBlockId.isSome());
}
break;
@@ -532,8 +535,10 @@ void APZEventState::ProcessAPZStateChange(ViewID aViewId,
break;
}
case APZStateChange::eEndTouch: {
- mEndTouchIsClick = aArg;
- mActiveElementManager->HandleTouchEnd();
+ mEndTouchState = static_cast<apz::SingleTapState>(aArg);
+ if (mActiveElementManager->HandleTouchEnd(mEndTouchState)) {
+ mEndTouchState = apz::SingleTapState::NotClick;
+ }
break;
}
}