blob: 2fca448e24868e478e463ca8ae9bdc59c72ce44a [file] [log] [blame]
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +01001/*
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Ben Murdoch02772c62013-07-26 10:21:05 +010023 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010024 */
25
26#ifndef EventHandler_h
27#define EventHandler_h
28
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010029#include "core/editing/TextGranularity.h"
Torne (Richard Coles)1e202182013-10-18 15:46:42 +010030#include "core/events/TextEventInputType.h"
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010031#include "core/page/DragActions.h"
32#include "core/page/FocusDirection.h"
33#include "core/platform/Cursor.h"
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010034#include "core/rendering/HitTestRequest.h"
Torne (Richard Coles)1e202182013-10-18 15:46:42 +010035#include "platform/PlatformMouseEvent.h"
36#include "platform/Timer.h"
37#include "platform/UserGestureIndicator.h"
38#include "platform/geometry/LayoutPoint.h"
39#include "platform/scroll/ScrollTypes.h"
Ben Murdoch591b9582013-07-10 11:41:44 +010040#include "wtf/Forward.h"
41#include "wtf/HashMap.h"
42#include "wtf/RefPtr.h"
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010043
44namespace WebCore {
45
Torne (Richard Coles)19cde672013-11-06 12:28:04 +000046class AutoscrollController;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010047class Clipboard;
48class Document;
49class Element;
50class Event;
51class EventTarget;
52class FloatPoint;
53class FloatQuad;
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +010054class FullscreenElementStack;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010055class Frame;
56class HTMLFrameSetElement;
57class HitTestRequest;
58class HitTestResult;
59class KeyboardEvent;
60class MouseEventWithHitTestResults;
61class Node;
62class OptionalCursor;
63class PlatformGestureEvent;
64class PlatformKeyboardEvent;
65class PlatformTouchEvent;
66class PlatformWheelEvent;
67class RenderLayer;
Torne (Richard Coles)f79f16f2013-10-31 11:16:44 +000068class RenderLayerScrollableArea;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010069class RenderObject;
70class RenderWidget;
71class SVGElementInstance;
Torne (Richard Coles)e1f1df52013-08-23 16:39:30 +010072class ScrollableArea;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010073class Scrollbar;
74class TextEvent;
75class TouchEvent;
76class VisibleSelection;
77class WheelEvent;
78class Widget;
79
80struct DragState;
81
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010082enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTrailingWhitespace };
83enum CheckDragHysteresis { ShouldCheckDragHysteresis, DontCheckDragHysteresis };
84
85class EventHandler {
86 WTF_MAKE_NONCOPYABLE(EventHandler);
87public:
88 explicit EventHandler(Frame*);
89 ~EventHandler();
90
91 void clear();
Torne (Richard Coles)19cde672013-11-06 12:28:04 +000092 void nodeWillBeRemoved(Node&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010093
94 void updateSelectionForMouseDrag();
95
96 Node* mousePressNode() const;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010097
Torne (Richard Coles)8abfc582013-09-12 12:10:38 +010098#if OS(WIN)
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010099 void startPanScrolling(RenderObject*);
100#endif
101
Torne (Richard Coles)19cde672013-11-06 12:28:04 +0000102 void stopAutoscroll();
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100103
104 void dispatchFakeMouseMoveEventSoon();
105 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
106
107 HitTestResult hitTestResultAtPoint(const LayoutPoint&,
Ben Murdoch591b9582013-07-10 11:41:44 +0100108 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active,
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100109 const LayoutSize& padding = LayoutSize());
110
111 bool mousePressed() const { return m_mousePressed; }
112 void setMousePressed(bool pressed) { m_mousePressed = pressed; }
113
114 void setCapturingMouseEventsNode(PassRefPtr<Node>); // A caller is responsible for resetting capturing node to 0.
115
116 bool updateDragAndDrop(const PlatformMouseEvent&, Clipboard*);
117 void cancelDragAndDrop(const PlatformMouseEvent&, Clipboard*);
118 bool performDragAndDrop(const PlatformMouseEvent&, Clipboard*);
119 void updateDragStateAfterEditDragIfNeeded(Element* rootEditableElement);
120
121 void scheduleHoverStateUpdate();
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100122 void scheduleCursorUpdate();
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100123
124 void setResizingFrameSet(HTMLFrameSetElement*);
125
Torne (Richard Coles)f79f16f2013-10-31 11:16:44 +0000126 void resizeScrollableAreaDestroyed();
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100127
128 IntPoint lastKnownMousePosition() const;
129 Cursor currentMouseCursor() const { return m_currentMouseCursor; }
130
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100131 bool scrollOverflow(ScrollDirection, ScrollGranularity, Node* startingNode = 0);
132 bool scrollRecursively(ScrollDirection, ScrollGranularity, Node* startingNode = 0);
133 bool logicalScrollRecursively(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
134
Torne (Richard Coles)c0e19a62013-08-30 15:15:11 +0100135 bool handleMouseMoveEvent(const PlatformMouseEvent&);
136 void handleMouseLeaveEvent(const PlatformMouseEvent&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100137
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100138 bool handleMousePressEvent(const PlatformMouseEvent&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100139 bool handleMouseReleaseEvent(const PlatformMouseEvent&);
140 bool handleWheelEvent(const PlatformWheelEvent&);
141 void defaultWheelEventHandler(Node*, WheelEvent*);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100142
143 bool handleGestureEvent(const PlatformGestureEvent&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100144 bool handleGestureScrollEnd(const PlatformGestureEvent&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100145 bool isScrollbarHandlingGestures() const;
146
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100147 bool bestClickableNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode);
148 bool bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode);
149 bool bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntRect& targetArea, Node*& targetNode);
150
151 bool adjustGesturePosition(const PlatformGestureEvent&, IntPoint& adjustedPoint);
152
153 bool sendContextMenuEvent(const PlatformMouseEvent&);
154 bool sendContextMenuEventForKey();
155 bool sendContextMenuEventForGesture(const PlatformGestureEvent&);
156
157 void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true; }
158
159 static unsigned accessKeyModifiers();
160 bool handleAccessKey(const PlatformKeyboardEvent&);
161 bool keyEvent(const PlatformKeyboardEvent&);
162 void defaultKeyboardEventHandler(KeyboardEvent*);
163
164 bool handleTextInputEvent(const String& text, Event* underlyingEvent = 0, TextEventInputType = TextEventInputKeyboard);
165 void defaultTextInputEventHandler(TextEvent*);
166
167 void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation);
168
169 void focusDocumentView();
170
171 void capsLockStateMayHaveChanged(); // Only called by FrameSelection
172
173 void sendResizeEvent(); // Only called in FrameView
174 void sendScrollEvent(); // Ditto
175
176 bool handleTouchEvent(const PlatformTouchEvent&);
177
178 bool useHandCursor(Node*, bool isOverLink, bool shiftKey);
179
180private:
181 static DragState& dragState();
Ben Murdoch02772c62013-07-26 10:21:05 +0100182
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100183 PassRefPtr<Clipboard> createDraggingClipboard() const;
184
185 bool updateSelectionForMouseDownDispatchingSelectStart(Node*, const VisibleSelection&, TextGranularity);
186 void selectClosestWordFromHitTestResult(const HitTestResult&, AppendTrailingWhitespace);
Torne (Richard Coles)5267f702013-06-11 10:57:24 +0100187 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, AppendTrailingWhitespace);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100188 void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&);
Torne (Richard Coles)5267f702013-06-11 10:57:24 +0100189 void selectClosestMisspellingFromMouseEvent(const MouseEventWithHitTestResults&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100190 void selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults&);
191
Torne (Richard Coles)c0e19a62013-08-30 15:15:11 +0100192 bool handleMouseMoveOrLeaveEvent(const PlatformMouseEvent&, HitTestResult* hoveredNode = 0, bool onlyUpdateScrollbars = false);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100193 bool handleMousePressEvent(const MouseEventWithHitTestResults&);
194 bool handleMousePressEventSingleClick(const MouseEventWithHitTestResults&);
195 bool handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&);
196 bool handleMousePressEventTripleClick(const MouseEventWithHitTestResults&);
197 bool handleMouseDraggedEvent(const MouseEventWithHitTestResults&);
198 bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&);
199
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100200 bool handlePasteGlobalSelection(const PlatformMouseEvent&);
201
202 bool handleGestureTap(const PlatformGestureEvent&);
203 bool handleGestureLongPress(const PlatformGestureEvent&);
204 bool handleGestureLongTap(const PlatformGestureEvent&);
205 bool handleGestureTwoFingerTap(const PlatformGestureEvent&);
206 bool handleGestureScrollUpdate(const PlatformGestureEvent&);
207 bool handleGestureScrollBegin(const PlatformGestureEvent&);
208 void clearGestureScrollNodes();
209
210 bool shouldApplyTouchAdjustment(const PlatformGestureEvent&) const;
211
212 OptionalCursor selectCursor(const HitTestResult&, bool shiftKey);
Torne (Richard Coles)bfe35902013-10-22 16:41:51 +0100213 OptionalCursor selectAutoCursor(const HitTestResult&, Node*, const Cursor& iBeam, bool shiftKey);
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100214
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100215 void hoverTimerFired(Timer<EventHandler>*);
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100216 void cursorUpdateTimerFired(Timer<EventHandler>*);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100217
218 bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
Ben Murdoch02772c62013-07-26 10:21:05 +0100219
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100220 bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const;
221 bool mouseDownMayStartSelect() const { return m_mouseDownMayStartSelect; }
222
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100223 void fakeMouseMoveEventTimerFired(Timer<EventHandler>*);
224 void cancelFakeMouseMoveEvent();
225 bool isCursorVisible() const;
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100226 void updateCursor();
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100227
228 bool isInsideScrollbar(const IntPoint&) const;
229
Torne (Richard Coles)e1f1df52013-08-23 16:39:30 +0100230 ScrollableArea* associatedScrollableArea(const RenderLayer*) const;
231
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100232 bool dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent&);
Torne (Richard Coles)19cde672013-11-06 12:28:04 +0000233 bool handleMouseEventAsEmulatedGesture(const PlatformMouseEvent&);
234 bool handleWheelEventAsEmulatedGesture(const PlatformWheelEvent&);
235 HitTestResult hitTestResultInFrame(Frame*, const LayoutPoint&, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100236
237 void invalidateClick();
238
239 Node* nodeUnderMouse() const;
Ben Murdoch02772c62013-07-26 10:21:05 +0100240
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100241 void updateMouseEventTargetNode(Node*, const PlatformMouseEvent&, bool fireMouseOverOut);
Ben Murdoch02772c62013-07-26 10:21:05 +0100242
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100243 MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const PlatformMouseEvent&);
244
245 bool dispatchMouseEvent(const AtomicString& eventType, Node* target, bool cancelable, int clickCount, const PlatformMouseEvent&, bool setUnder);
246 bool dispatchDragEvent(const AtomicString& eventType, Node* target, const PlatformMouseEvent&, Clipboard*);
247
248 void freeClipboard();
249
250 bool handleDrag(const MouseEventWithHitTestResults&, CheckDragHysteresis);
Ben Murdoche69819b2013-07-17 14:56:49 +0100251 bool tryStartDrag(const MouseEventWithHitTestResults&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100252 void clearDragState();
253
254 bool dispatchDragSrcEvent(const AtomicString& eventType, const PlatformMouseEvent&);
255
256 bool dragHysteresisExceeded(const FloatPoint&) const;
257 bool dragHysteresisExceeded(const IntPoint&) const;
258
259 bool passMousePressEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe);
260 bool passMouseMoveEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe, HitTestResult* hoveredNode = 0);
261 bool passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe);
262
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100263 bool passMousePressEventToScrollbar(MouseEventWithHitTestResults&, Scrollbar*);
264
265 bool passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&);
266
267 bool passWheelEventToWidget(const PlatformWheelEvent&, Widget*);
268
269 void defaultSpaceEventHandler(KeyboardEvent*);
270 void defaultBackspaceEventHandler(KeyboardEvent*);
271 void defaultTabEventHandler(KeyboardEvent*);
Torne (Richard Coles)c0e19a62013-08-30 15:15:11 +0100272 void defaultEscapeEventHandler(KeyboardEvent*);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100273 void defaultArrowEventHandler(FocusDirection, KeyboardEvent*);
274
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100275 void updateSelectionForMouseDrag(const HitTestResult&);
276
277 void updateLastScrollbarUnderMouse(Scrollbar*, bool);
Ben Murdoch02772c62013-07-26 10:21:05 +0100278
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100279 void setFrameWasScrolledByUser();
280
281 bool capturesDragging() const { return m_capturesDragging; }
282
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +0100283 bool isKeyEventAllowedInFullScreen(FullscreenElementStack*, const PlatformKeyboardEvent&) const;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100284
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100285 bool handleGestureShowPress();
Torne (Richard Coles)81a51572013-05-13 16:52:28 +0100286
287 bool handleScrollGestureOnResizer(Node*, const PlatformGestureEvent&);
288
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100289 bool passGestureEventToWidget(const PlatformGestureEvent&, Widget*);
290 bool passGestureEventToWidgetIfPossible(const PlatformGestureEvent&, RenderObject*);
291 bool sendScrollEventToView(const PlatformGestureEvent&, const FloatSize&);
292 Frame* getSubFrameForGestureEvent(const IntPoint& touchAdjustedPoint, const PlatformGestureEvent&);
293
Torne (Richard Coles)19cde672013-11-06 12:28:04 +0000294 AutoscrollController* autoscrollController() const;
Torne (Richard Coles)5267f702013-06-11 10:57:24 +0100295 bool panScrollInProgress() const;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100296 void setLastKnownMousePosition(const PlatformMouseEvent&);
297
Ben Murdoche69819b2013-07-17 14:56:49 +0100298 Frame* const m_frame;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100299
300 bool m_mousePressed;
301 bool m_capturesDragging;
302 RefPtr<Node> m_mousePressNode;
303
304 bool m_mouseDownMayStartSelect;
305 bool m_mouseDownMayStartDrag;
306 bool m_dragMayStartSelectionInstead;
307 bool m_mouseDownWasSingleClickInSelection;
308 enum SelectionInitiationState { HaveNotStartedSelection, PlacedCaret, ExtendedSelection };
309 SelectionInitiationState m_selectionInitiationState;
310
311 LayoutPoint m_dragStartPos;
312
313 bool m_panScrollButtonPressed;
314
315 Timer<EventHandler> m_hoverTimer;
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100316 Timer<EventHandler> m_cursorUpdateTimer;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100317
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100318 bool m_mouseDownMayStartAutoscroll;
319 bool m_mouseDownWasInSubframe;
320
321 Timer<EventHandler> m_fakeMouseMoveEventTimer;
322
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100323 bool m_svgPan;
324 RefPtr<SVGElementInstance> m_instanceUnderMouse;
325 RefPtr<SVGElementInstance> m_lastInstanceUnderMouse;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100326
Torne (Richard Coles)f79f16f2013-10-31 11:16:44 +0000327 RenderLayerScrollableArea* m_resizeScrollableArea;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100328
329 RefPtr<Node> m_capturingMouseEventsNode;
330 bool m_eventHandlerWillResetCapturingMouseEventsNode;
Ben Murdoch02772c62013-07-26 10:21:05 +0100331
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100332 RefPtr<Node> m_nodeUnderMouse;
333 RefPtr<Node> m_lastNodeUnderMouse;
334 RefPtr<Frame> m_lastMouseMoveEventSubframe;
335 RefPtr<Scrollbar> m_lastScrollbarUnderMouse;
336 Cursor m_currentMouseCursor;
337
338 int m_clickCount;
339 RefPtr<Node> m_clickNode;
340
341 RefPtr<Node> m_dragTarget;
342 bool m_shouldOnlyFireDragOverEvent;
Ben Murdoch02772c62013-07-26 10:21:05 +0100343
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100344 RefPtr<HTMLFrameSetElement> m_frameSetBeingResized;
345
Torne (Richard Coles)f79f16f2013-10-31 11:16:44 +0000346 LayoutSize m_offsetFromResizeCorner; // In the coords of m_resizeScrollableArea.
Ben Murdoch02772c62013-07-26 10:21:05 +0100347
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100348 bool m_mousePositionIsUnknown;
349 IntPoint m_lastKnownMousePosition;
350 IntPoint m_lastKnownMouseGlobalPosition;
351 IntPoint m_mouseDownPos; // In our view's coords.
352 double m_mouseDownTimestamp;
353 PlatformMouseEvent m_mouseDown;
354 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken;
355
356 RefPtr<Node> m_latchedWheelEventNode;
357 bool m_widgetIsLatched;
358
359 RefPtr<Node> m_previousWheelScrolledNode;
360
361 typedef HashMap<int, RefPtr<EventTarget> > TouchTargetMap;
362 TouchTargetMap m_originatingTouchPointTargets;
363 RefPtr<Document> m_originatingTouchPointDocument;
364 unsigned m_originatingTouchPointTargetKey;
365 bool m_touchPressed;
366
367 RefPtr<Node> m_scrollGestureHandlingNode;
368 bool m_lastHitTestResultOverWidget;
369 RefPtr<Node> m_previousGestureScrolledNode;
370 RefPtr<Scrollbar> m_scrollbarHandlingScrollGesture;
371
372 double m_maxMouseMovedDuration;
373 PlatformEvent::Type m_baseEventType;
374 bool m_didStartDrag;
375
376 bool m_longTapShouldInvokeContextMenu;
Torne (Richard Coles)19cde672013-11-06 12:28:04 +0000377 OwnPtr<IntPoint> m_lastSyntheticPinchAnchorCss;
378 OwnPtr<IntPoint> m_lastSyntheticPinchAnchorDip;
379 OwnPtr<IntPoint> m_lastSyntheticPanLocation;
380 float m_syntheticPageScaleFactor;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100381};
382
383} // namespace WebCore
384
385#endif // EventHandler_h