From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- layout/base/TouchManager.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'layout/base/TouchManager.h') diff --git a/layout/base/TouchManager.h b/layout/base/TouchManager.h index 0e12c25c7d..40b9083bdb 100644 --- a/layout/base/TouchManager.h +++ b/layout/base/TouchManager.h @@ -12,6 +12,7 @@ #ifndef TouchManager_h_ #define TouchManager_h_ +#include "Units.h" #include "mozilla/BasicEvents.h" #include "mozilla/dom/Touch.h" #include "mozilla/StaticPtr.h" @@ -20,6 +21,7 @@ namespace mozilla { class PresShell; +class TimeStamp; class TouchManager { public: @@ -52,6 +54,8 @@ class TouchManager { bool PreHandleEvent(mozilla::WidgetEvent* aEvent, nsEventStatus* aStatus, bool& aTouchIsNew, nsCOMPtr& aCurrentEventContent); + void PostHandleEvent(const mozilla::WidgetEvent* aEvent, + const nsEventStatus* aStatus); static already_AddRefed GetAnyCapturedTouchTarget(); static bool HasCapturedTouch(int32_t aId); @@ -59,6 +63,12 @@ class TouchManager { static bool ShouldConvertTouchToPointer(const dom::Touch* aTouch, const WidgetTouchEvent* aEvent); + // This should be called after PostHandleEvent() is called. Note that this + // cannot check touches outside this process. So, this should not be used for + // actual user input handling. This is designed for a fallback path to + // dispatch mouse events for touch events synthesized without APZ. + static bool IsSingleTapEndToDoDefault(const WidgetTouchEvent* aTouchEndEvent); + private: void EvictTouches(dom::Document* aLimitToDocument = nullptr); static void EvictTouchPoint(RefPtr& aTouch, @@ -77,6 +87,12 @@ class TouchManager { static StaticAutoPtr> sCaptureTouchList; static layers::LayersId sCaptureTouchLayersId; + // The last start of a single tap. This will be set to "Null" if the tap is + // consumed or becomes not a single tap. + static TimeStamp sSingleTouchStartTimeStamp; + // The last start point of the single tap tracked with + // sSingleTouchStartTimeStamp. + static LayoutDeviceIntPoint sSingleTouchStartPoint; }; } // namespace mozilla -- cgit v1.2.3