summaryrefslogtreecommitdiffstats
path: root/gfx/layers/apz/src
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /gfx/layers/apz/src
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/layers/apz/src')
-rw-r--r--gfx/layers/apz/src/AsyncPanZoomController.cpp10
-rw-r--r--gfx/layers/apz/src/FocusState.cpp1
-rw-r--r--gfx/layers/apz/src/InputBlockState.h4
-rw-r--r--gfx/layers/apz/src/InputQueue.cpp14
4 files changed, 23 insertions, 6 deletions
diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp
index a070340421..84b4a95b9e 100644
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -1988,6 +1988,10 @@ ParentLayerPoint AsyncPanZoomController::GetScrollWheelDelta(
// Apply user-set multipliers.
delta.x *= aMultiplierX;
delta.y *= aMultiplierY;
+ APZC_LOGV(
+ "user-multiplied delta is %s (deltaType %d, line size %s, page size %s)",
+ ToString(delta).c_str(), (int)aEvent.mDeltaType,
+ ToString(scrollAmount).c_str(), ToString(pageScrollSize).c_str());
// For the conditions under which we allow system scroll overrides, see
// WidgetWheelEvent::OverriddenDelta{X,Y}.
@@ -1999,6 +2003,7 @@ ParentLayerPoint AsyncPanZoomController::GetScrollWheelDelta(
aEvent.mAllowToOverrideSystemScrollSpeed) {
delta.x = WidgetWheelEvent::ComputeOverriddenDelta(delta.x, false);
delta.y = WidgetWheelEvent::ComputeOverriddenDelta(delta.y, true);
+ APZC_LOGV("overridden delta is %s", ToString(delta).c_str());
}
// If this is a line scroll, and this event was part of a scroll series, then
@@ -2258,6 +2263,8 @@ bool AsyncPanZoomController::AllowOneTouchPinch() const {
// Return whether or not the underlying layer can be scrolled on either axis.
bool AsyncPanZoomController::CanScroll(const InputData& aEvent) const {
ParentLayerPoint delta = GetDeltaForEvent(aEvent);
+ APZC_LOGV_DETAIL("CanScroll: event delta is %s", this,
+ ToString(delta).c_str());
if (!delta.x && !delta.y) {
return false;
}
@@ -2330,6 +2337,9 @@ bool AsyncPanZoomController::CanScrollWithWheel(
disregardedDirection != Some(ScrollDirection::eVertical)) {
return true;
}
+ APZC_LOGV_FM(Metrics(),
+ "cannot scroll with wheel (disregarded direction is %s)",
+ ToString(disregardedDirection).c_str());
return false;
}
diff --git a/gfx/layers/apz/src/FocusState.cpp b/gfx/layers/apz/src/FocusState.cpp
index 0230676e7e..84bf0b4570 100644
--- a/gfx/layers/apz/src/FocusState.cpp
+++ b/gfx/layers/apz/src/FocusState.cpp
@@ -7,6 +7,7 @@
#include "FocusState.h"
#include "mozilla/Logging.h"
+#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/layers/APZThreadUtils.h"
static mozilla::LazyLogModule sApzFstLog("apz.focusstate");
diff --git a/gfx/layers/apz/src/InputBlockState.h b/gfx/layers/apz/src/InputBlockState.h
index d65b1cb57b..d27e7ead27 100644
--- a/gfx/layers/apz/src/InputBlockState.h
+++ b/gfx/layers/apz/src/InputBlockState.h
@@ -501,9 +501,9 @@ class TouchBlockState : public CancelableBlockState {
mIsWaitingLongTapResult = false;
}
- void SetWaitingLongTapResult() {
+ void SetWaitingLongTapResult(bool aResult) {
MOZ_ASSERT(!mForLongTap);
- mIsWaitingLongTapResult = true;
+ mIsWaitingLongTapResult = aResult;
}
bool IsWaitingLongTapResult() const { return mIsWaitingLongTapResult; }
diff --git a/gfx/layers/apz/src/InputQueue.cpp b/gfx/layers/apz/src/InputQueue.cpp
index 8ad75a9794..78b70fddf4 100644
--- a/gfx/layers/apz/src/InputQueue.cpp
+++ b/gfx/layers/apz/src/InputQueue.cpp
@@ -204,8 +204,8 @@ APZEventResult InputQueue::ReceiveTouchInput(
} else {
// If all following conditions are met, we need to wait for a content
// response (again);
- // 1) this is the first event bailing out from in-slop state after a
- // long-tap event has been fired
+ // 1) this is the first touch-move event bailing out from in-slop state
+ // after a long-tap event has been fired
// 2) there's any APZ-aware event listeners
// 3) the event block hasn't yet been prevented
//
@@ -216,7 +216,7 @@ APZEventResult InputQueue::ReceiveTouchInput(
// until a long-tap event happens, then if the user started moving their
// finger, we have to wait for a content response twice, one is for
// `touchstart` and one is for `touchmove`.
- if (wasInSlop &&
+ if (wasInSlop && aEvent.mType == MultiTouchInput::MULTITOUCH_MOVE &&
(block->WasLongTapProcessed() || block->IsWaitingLongTapResult()) &&
!block->IsTargetOriginallyConfirmed() && !block->ShouldDropEvents()) {
INPQ_LOG(
@@ -637,6 +637,12 @@ uint64_t InputQueue::InjectNewTouchBlock(AsyncPanZoomController* aTarget) {
TouchBlockState* InputQueue::StartNewTouchBlock(
const RefPtr<AsyncPanZoomController>& aTarget,
TargetConfirmationFlags aFlags) {
+ if (mPrevActiveTouchBlock && mActiveTouchBlock &&
+ mActiveTouchBlock->ForLongTap()) {
+ mPrevActiveTouchBlock->SetWaitingLongTapResult(false);
+ mPrevActiveTouchBlock = nullptr;
+ }
+
TouchBlockState* newBlock =
new TouchBlockState(aTarget, aFlags, mTouchCounter);
@@ -664,7 +670,7 @@ TouchBlockState* InputQueue::StartNewTouchBlockForLongTap(
// touch block because if the long-tap event response prevents us from
// scrolling we must stop processing any subsequent touch-move events in the
// same block.
- currentBlock->SetWaitingLongTapResult();
+ currentBlock->SetWaitingLongTapResult(true);
// We need to keep the current block alive, it will be used once after this
// new touch block for long-tap was processed.