| Index: third_party/WebKit/Source/core/input/PointerEventManager.h
|
| diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.h b/third_party/WebKit/Source/core/input/PointerEventManager.h
|
| index 6b33a8d73985c6d2652af02291c1afc152772df2..19ffb8e3e9d1e62d632a523240725bffe59ffac0 100644
|
| --- a/third_party/WebKit/Source/core/input/PointerEventManager.h
|
| +++ b/third_party/WebKit/Source/core/input/PointerEventManager.h
|
| @@ -28,11 +28,16 @@ public:
|
| ~PointerEventManager();
|
| DECLARE_TRACE();
|
|
|
| + // Sends the mouse pointer events and the boundary events
|
| + // that it may cause. It also sends the compat mouse events
|
| + // and sets the newNodeUnderMouse if the capturing is set
|
| + // in this function.
|
| WebInputEventResult sendMousePointerEvent(
|
| - Node*, const AtomicString& type,
|
| + Node* target, const AtomicString& type,
|
| int clickCount, const PlatformMouseEvent&,
|
| Node* relatedTarget,
|
| - Node* lastNodeUnderMouse);
|
| + Node* lastNodeUnderMouse,
|
| + Node** newNodeUnderMouse);
|
|
|
| WebInputEventResult handleTouchEvents(
|
| const PlatformTouchEvent&);
|
| @@ -65,16 +70,20 @@ public:
|
| // Returns whether there is any touch on the screen.
|
| bool isAnyTouchActive() const;
|
|
|
| + // TODO(crbug.com/625843): This can be hidden when mouse refactoring in EventHandler is done.
|
| + EventTarget* getMouseCapturingNode();
|
| +
|
| // Returns true if the primary pointerdown corresponding to the given
|
| // |uniqueTouchEventId| was canceled. Also drops stale ids from
|
| // |m_touchIdsForCanceledPointerdowns|.
|
| bool primaryPointerdownCanceled(uint32_t uniqueTouchEventId);
|
|
|
| - // Try to immediately send the got/lostpointercapture without boundary
|
| - // events.
|
| + // Processes the assignment of |m_pointerCaptureTarget| from |m_pendingPointerCaptureTarget|
|
| + // and sends the got/lostpointercapture events, as per the spec:
|
| + // https://w3c.github.io/pointerevents/#process-pending-pointer-capture
|
| // TODO(crbug.com/629935): This function should be private as soon as PointerEventManager
|
| // a GC managed object and postTask can be done internally in this class.
|
| - void immediatelyProcessPendingPointerCapture(int pointerId);
|
| + void processPendingPointerCapture(int pointerId);
|
|
|
| private:
|
| typedef HeapHashMap<int, Member<EventTarget>, WTF::IntHash<int>,
|
| @@ -121,24 +130,14 @@ private:
|
| const PlatformMouseEvent& = PlatformMouseEvent(),
|
| bool sendMouseEvent = false);
|
| void setNodeUnderPointer(PointerEvent*,
|
| - EventTarget*, bool sendEvent = true);
|
| -
|
| - // Processes the assignment of |m_pointerCaptureTarget| from |m_pendingPointerCaptureTarget|
|
| - // and sends the got/lostpointercapture events, as per the spec:
|
| - // https://w3c.github.io/pointerevents/#process-pending-pointer-capture
|
| - // Returns whether the pointer capture is changed. When pointer capture is changed,
|
| - // this function will take care of boundary events.
|
| - bool processPendingPointerCapture(
|
| - PointerEvent*,
|
| - EventTarget*,
|
| - const PlatformMouseEvent& = PlatformMouseEvent(),
|
| - bool sendMouseEvent = false);
|
| + EventTarget*);
|
|
|
| // Processes the capture state of a pointer, updates node under
|
| // pointer, and sends corresponding boundary events for pointer if
|
| // setPointerPosition is true. It also sends corresponding boundary events
|
| // for mouse if sendMouseEvent is true.
|
| - void processCaptureAndPositionOfPointerEvent(
|
| + // Returns the target that the pointer event is supposed to be fired at.
|
| + EventTarget* processCaptureAndPositionOfPointerEvent(
|
| PointerEvent*,
|
| EventTarget* hitTestTarget,
|
| EventTarget* lastNodeUnderMouse = nullptr,
|
| @@ -156,7 +155,12 @@ private:
|
| EventTarget*,
|
| PointerEvent*,
|
| bool checkForListener = false);
|
| - void modifyPendingPointerCapture(int pointerId, EventTarget*);
|
| + // Set |m_pendingPointerCaptureTarget| for the given pointerId to the given
|
| + // target. It calls |processPendingPointerCapture| immediately if immediate
|
| + // is set. Otherwise it schedules it based on the heuristic to prevent
|
| + // the infinite look between lost/gotpointercapture handlers.
|
| + void modifyPendingPointerCapture(int pointerId, EventTarget*,
|
| + bool immediate = false);
|
| // Returns true if capture target and pending capture target were different.
|
| bool getPointerCaptureState(int pointerId,
|
| EventTarget** pointerCaptureTarget,
|
|
|