blob: f22e7fe73ef8dfb9debcfe4fcf3862da6eaec310 [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
Torne (Richard Coles)51b29062013-11-28 11:56:03 +0000173 void sendScrollEvent(); // Only called in FrameView
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100174
175 bool handleTouchEvent(const PlatformTouchEvent&);
176
177 bool useHandCursor(Node*, bool isOverLink, bool shiftKey);
178
179private:
180 static DragState& dragState();
Ben Murdoch02772c62013-07-26 10:21:05 +0100181
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100182 PassRefPtr<Clipboard> createDraggingClipboard() const;
183
184 bool updateSelectionForMouseDownDispatchingSelectStart(Node*, const VisibleSelection&, TextGranularity);
185 void selectClosestWordFromHitTestResult(const HitTestResult&, AppendTrailingWhitespace);
Torne (Richard Coles)5267f702013-06-11 10:57:24 +0100186 void selectClosestMisspellingFromHitTestResult(const HitTestResult&, AppendTrailingWhitespace);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100187 void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&);
Torne (Richard Coles)5267f702013-06-11 10:57:24 +0100188 void selectClosestMisspellingFromMouseEvent(const MouseEventWithHitTestResults&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100189 void selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults&);
190
Torne (Richard Coles)c0e19a62013-08-30 15:15:11 +0100191 bool handleMouseMoveOrLeaveEvent(const PlatformMouseEvent&, HitTestResult* hoveredNode = 0, bool onlyUpdateScrollbars = false);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100192 bool handleMousePressEvent(const MouseEventWithHitTestResults&);
193 bool handleMousePressEventSingleClick(const MouseEventWithHitTestResults&);
194 bool handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&);
195 bool handleMousePressEventTripleClick(const MouseEventWithHitTestResults&);
196 bool handleMouseDraggedEvent(const MouseEventWithHitTestResults&);
197 bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&);
198
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100199 bool handlePasteGlobalSelection(const PlatformMouseEvent&);
200
201 bool handleGestureTap(const PlatformGestureEvent&);
Torne (Richard Coles)51b29062013-11-28 11:56:03 +0000202 bool handleGestureLongPress(const PlatformGestureEvent&, const IntPoint& adjustedPoint);
203 bool handleGestureLongTap(const PlatformGestureEvent&, const IntPoint& adjustedPoint);
204 bool handleGestureTwoFingerTap(const PlatformGestureEvent&, const IntPoint& adjustedPoint);
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100205 bool handleGestureScrollUpdate(const PlatformGestureEvent&);
206 bool handleGestureScrollBegin(const PlatformGestureEvent&);
207 void clearGestureScrollNodes();
208
209 bool shouldApplyTouchAdjustment(const PlatformGestureEvent&) const;
210
211 OptionalCursor selectCursor(const HitTestResult&, bool shiftKey);
Torne (Richard Coles)bfe35902013-10-22 16:41:51 +0100212 OptionalCursor selectAutoCursor(const HitTestResult&, Node*, const Cursor& iBeam, bool shiftKey);
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100213
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100214 void hoverTimerFired(Timer<EventHandler>*);
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100215 void cursorUpdateTimerFired(Timer<EventHandler>*);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100216
217 bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
Ben Murdoch02772c62013-07-26 10:21:05 +0100218
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100219 bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const;
220 bool mouseDownMayStartSelect() const { return m_mouseDownMayStartSelect; }
221
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100222 void fakeMouseMoveEventTimerFired(Timer<EventHandler>*);
223 void cancelFakeMouseMoveEvent();
224 bool isCursorVisible() const;
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100225 void updateCursor();
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100226
227 bool isInsideScrollbar(const IntPoint&) const;
228
Torne (Richard Coles)e1f1df52013-08-23 16:39:30 +0100229 ScrollableArea* associatedScrollableArea(const RenderLayer*) const;
230
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100231 bool dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent&);
Torne (Richard Coles)19cde672013-11-06 12:28:04 +0000232 bool handleMouseEventAsEmulatedGesture(const PlatformMouseEvent&);
233 bool handleWheelEventAsEmulatedGesture(const PlatformWheelEvent&);
234 HitTestResult hitTestResultInFrame(Frame*, const LayoutPoint&, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::ConfusingAndOftenMisusedDisallowShadowContent);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100235
236 void invalidateClick();
237
238 Node* nodeUnderMouse() const;
Ben Murdoch02772c62013-07-26 10:21:05 +0100239
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100240 void updateMouseEventTargetNode(Node*, const PlatformMouseEvent&, bool fireMouseOverOut);
Ben Murdoch02772c62013-07-26 10:21:05 +0100241
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100242 MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const PlatformMouseEvent&);
243
244 bool dispatchMouseEvent(const AtomicString& eventType, Node* target, bool cancelable, int clickCount, const PlatformMouseEvent&, bool setUnder);
245 bool dispatchDragEvent(const AtomicString& eventType, Node* target, const PlatformMouseEvent&, Clipboard*);
246
247 void freeClipboard();
248
249 bool handleDrag(const MouseEventWithHitTestResults&, CheckDragHysteresis);
Ben Murdoche69819b2013-07-17 14:56:49 +0100250 bool tryStartDrag(const MouseEventWithHitTestResults&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100251 void clearDragState();
252
253 bool dispatchDragSrcEvent(const AtomicString& eventType, const PlatformMouseEvent&);
254
255 bool dragHysteresisExceeded(const FloatPoint&) const;
256 bool dragHysteresisExceeded(const IntPoint&) const;
257
258 bool passMousePressEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe);
259 bool passMouseMoveEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe, HitTestResult* hoveredNode = 0);
260 bool passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe);
261
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100262 bool passMousePressEventToScrollbar(MouseEventWithHitTestResults&, Scrollbar*);
263
264 bool passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&);
265
266 bool passWheelEventToWidget(const PlatformWheelEvent&, Widget*);
267
268 void defaultSpaceEventHandler(KeyboardEvent*);
269 void defaultBackspaceEventHandler(KeyboardEvent*);
270 void defaultTabEventHandler(KeyboardEvent*);
Torne (Richard Coles)c0e19a62013-08-30 15:15:11 +0100271 void defaultEscapeEventHandler(KeyboardEvent*);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100272 void defaultArrowEventHandler(FocusDirection, KeyboardEvent*);
273
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100274 void updateSelectionForMouseDrag(const HitTestResult&);
275
276 void updateLastScrollbarUnderMouse(Scrollbar*, bool);
Ben Murdoch02772c62013-07-26 10:21:05 +0100277
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100278 void setFrameWasScrolledByUser();
279
280 bool capturesDragging() const { return m_capturesDragging; }
281
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +0100282 bool isKeyEventAllowedInFullScreen(FullscreenElementStack*, const PlatformKeyboardEvent&) const;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100283
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100284 bool handleGestureShowPress();
Torne (Richard Coles)81a51572013-05-13 16:52:28 +0100285
286 bool handleScrollGestureOnResizer(Node*, const PlatformGestureEvent&);
287
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100288 bool passGestureEventToWidget(const PlatformGestureEvent&, Widget*);
289 bool passGestureEventToWidgetIfPossible(const PlatformGestureEvent&, RenderObject*);
290 bool sendScrollEventToView(const PlatformGestureEvent&, const FloatSize&);
291 Frame* getSubFrameForGestureEvent(const IntPoint& touchAdjustedPoint, const PlatformGestureEvent&);
292
Torne (Richard Coles)19cde672013-11-06 12:28:04 +0000293 AutoscrollController* autoscrollController() const;
Torne (Richard Coles)5267f702013-06-11 10:57:24 +0100294 bool panScrollInProgress() const;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100295 void setLastKnownMousePosition(const PlatformMouseEvent&);
296
Ben Murdoche69819b2013-07-17 14:56:49 +0100297 Frame* const m_frame;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100298
299 bool m_mousePressed;
300 bool m_capturesDragging;
301 RefPtr<Node> m_mousePressNode;
302
303 bool m_mouseDownMayStartSelect;
304 bool m_mouseDownMayStartDrag;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100305 bool m_mouseDownWasSingleClickInSelection;
306 enum SelectionInitiationState { HaveNotStartedSelection, PlacedCaret, ExtendedSelection };
307 SelectionInitiationState m_selectionInitiationState;
308
309 LayoutPoint m_dragStartPos;
310
311 bool m_panScrollButtonPressed;
312
313 Timer<EventHandler> m_hoverTimer;
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100314 Timer<EventHandler> m_cursorUpdateTimer;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100315
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100316 bool m_mouseDownMayStartAutoscroll;
317 bool m_mouseDownWasInSubframe;
318
319 Timer<EventHandler> m_fakeMouseMoveEventTimer;
320
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100321 bool m_svgPan;
322 RefPtr<SVGElementInstance> m_instanceUnderMouse;
323 RefPtr<SVGElementInstance> m_lastInstanceUnderMouse;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100324
Torne (Richard Coles)f79f16f2013-10-31 11:16:44 +0000325 RenderLayerScrollableArea* m_resizeScrollableArea;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100326
327 RefPtr<Node> m_capturingMouseEventsNode;
328 bool m_eventHandlerWillResetCapturingMouseEventsNode;
Ben Murdoch02772c62013-07-26 10:21:05 +0100329
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100330 RefPtr<Node> m_nodeUnderMouse;
331 RefPtr<Node> m_lastNodeUnderMouse;
332 RefPtr<Frame> m_lastMouseMoveEventSubframe;
333 RefPtr<Scrollbar> m_lastScrollbarUnderMouse;
334 Cursor m_currentMouseCursor;
335
336 int m_clickCount;
337 RefPtr<Node> m_clickNode;
338
339 RefPtr<Node> m_dragTarget;
340 bool m_shouldOnlyFireDragOverEvent;
Ben Murdoch02772c62013-07-26 10:21:05 +0100341
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100342 RefPtr<HTMLFrameSetElement> m_frameSetBeingResized;
343
Torne (Richard Coles)f79f16f2013-10-31 11:16:44 +0000344 LayoutSize m_offsetFromResizeCorner; // In the coords of m_resizeScrollableArea.
Ben Murdoch02772c62013-07-26 10:21:05 +0100345
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100346 bool m_mousePositionIsUnknown;
347 IntPoint m_lastKnownMousePosition;
348 IntPoint m_lastKnownMouseGlobalPosition;
349 IntPoint m_mouseDownPos; // In our view's coords.
350 double m_mouseDownTimestamp;
351 PlatformMouseEvent m_mouseDown;
352 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken;
353
354 RefPtr<Node> m_latchedWheelEventNode;
355 bool m_widgetIsLatched;
356
357 RefPtr<Node> m_previousWheelScrolledNode;
358
359 typedef HashMap<int, RefPtr<EventTarget> > TouchTargetMap;
360 TouchTargetMap m_originatingTouchPointTargets;
361 RefPtr<Document> m_originatingTouchPointDocument;
362 unsigned m_originatingTouchPointTargetKey;
363 bool m_touchPressed;
364
365 RefPtr<Node> m_scrollGestureHandlingNode;
366 bool m_lastHitTestResultOverWidget;
367 RefPtr<Node> m_previousGestureScrolledNode;
368 RefPtr<Scrollbar> m_scrollbarHandlingScrollGesture;
369
370 double m_maxMouseMovedDuration;
371 PlatformEvent::Type m_baseEventType;
372 bool m_didStartDrag;
373
374 bool m_longTapShouldInvokeContextMenu;
Torne (Richard Coles)19cde672013-11-06 12:28:04 +0000375 OwnPtr<IntPoint> m_lastSyntheticPinchAnchorCss;
376 OwnPtr<IntPoint> m_lastSyntheticPinchAnchorDip;
377 OwnPtr<IntPoint> m_lastSyntheticPanLocation;
378 float m_syntheticPageScaleFactor;
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100379};
380
381} // namespace WebCore
382
383#endif // EventHandler_h