Use _NSScrollingPredominantAxisFilter for wheel event filtering on Mac
[WebKit-https.git] / Source / WebCore / page / EventHandler.h
1 /*
2  * Copyright (C) 2006-2015 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 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 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
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24  */
25
26 #ifndef EventHandler_h
27 #define EventHandler_h
28
29 #include "Cursor.h"
30 #include "DragActions.h"
31 #include "FocusDirection.h"
32 #include "HitTestRequest.h"
33 #include "LayoutPoint.h"
34 #include "PlatformMouseEvent.h"
35 #include "PlatformWheelEvent.h"
36 #include "ScrollTypes.h"
37 #include "TextEventInputType.h"
38 #include "TextGranularity.h"
39 #include "Timer.h"
40 #include "WheelEventDeltaFilter.h"
41 #include <memory>
42 #include <wtf/Forward.h>
43 #include <wtf/RefPtr.h>
44 #include <wtf/WeakPtr.h>
45
46 #if PLATFORM(IOS)
47 #ifdef __OBJC__
48 @class WebEvent;
49 @class WAKView;
50 #include "WAKAppKitStubs.h"
51 #else
52 class WebEvent;
53 #endif
54 #endif // PLATFORM(IOS)
55
56 #if PLATFORM(COCOA) && !defined(__OBJC__)
57 class NSView;
58 #endif
59
60 #if ENABLE(TOUCH_EVENTS)
61 #include <wtf/HashMap.h>
62 #endif
63
64 #if ENABLE(IOS_TOUCH_EVENTS)
65 #include <wtf/HashSet.h>
66 #include <wtf/Vector.h>
67 #endif
68
69 namespace WebCore {
70
71 class AutoscrollController;
72 class ContainerNode;
73 class DataTransfer;
74 class Document;
75 class Element;
76 class Event;
77 class EventTarget;
78 class FloatPoint;
79 class FloatQuad;
80 class Frame;
81 class HTMLFrameSetElement;
82 class HitTestRequest;
83 class HitTestResult;
84 class KeyboardEvent;
85 class MouseEventWithHitTestResults;
86 class Node;
87 class OptionalCursor;
88 class PlatformKeyboardEvent;
89 class PlatformTouchEvent;
90 class PlatformWheelEvent;
91 class RenderBox;
92 class RenderElement;
93 class RenderLayer;
94 class RenderWidget;
95 class ScrollableArea;
96 class Scrollbar;
97 class TextEvent;
98 class Touch;
99 class TouchEvent;
100 class VisibleSelection;
101 class WheelEvent;
102 class Widget;
103
104 struct DragState;
105
106 #if ENABLE(DRAG_SUPPORT)
107 extern const int LinkDragHysteresis;
108 extern const int ImageDragHysteresis;
109 extern const int TextDragHysteresis;
110 extern const int GeneralDragHysteresis;
111 #endif // ENABLE(DRAG_SUPPORT)
112
113 #if ENABLE(IOS_GESTURE_EVENTS)
114 extern const float GestureUnknown;
115 #endif
116
117 enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTrailingWhitespace };
118 enum CheckDragHysteresis { ShouldCheckDragHysteresis, DontCheckDragHysteresis };
119
120 enum class ImmediateActionStage {
121     None,
122     PerformedHitTest,
123     ActionUpdated,
124     ActionCancelled,
125     ActionCompleted
126 };
127
128 class EventHandler {
129     WTF_MAKE_NONCOPYABLE(EventHandler);
130     WTF_MAKE_FAST_ALLOCATED;
131 public:
132     explicit EventHandler(Frame&);
133     ~EventHandler();
134
135     void clear();
136     void nodeWillBeRemoved(Node&);
137
138 #if ENABLE(DRAG_SUPPORT)
139     void updateSelectionForMouseDrag();
140 #endif
141
142 #if ENABLE(PAN_SCROLLING)
143     void didPanScrollStart();
144     void didPanScrollStop();
145     void startPanScrolling(RenderElement*);
146 #endif
147
148     void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false);
149     RenderBox* autoscrollRenderer() const;
150     void updateAutoscrollRenderer();
151     bool autoscrollInProgress() const;
152     bool mouseDownWasInSubframe() const { return m_mouseDownWasInSubframe; }
153     bool panScrollInProgress() const;
154
155     WEBCORE_EXPORT void dispatchFakeMouseMoveEventSoon();
156     void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
157
158     WEBCORE_EXPORT HitTestResult hitTestResultAtPoint(const LayoutPoint&,
159         HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent,
160         const LayoutSize& padding = LayoutSize());
161
162     bool mousePressed() const { return m_mousePressed; }
163     Node* mousePressNode() const { return m_mousePressNode.get(); }
164
165     WEBCORE_EXPORT void setCapturingMouseEventsElement(PassRefPtr<Element>); // A caller is responsible for resetting capturing element to 0.
166
167 #if ENABLE(DRAG_SUPPORT)
168     bool updateDragAndDrop(const PlatformMouseEvent&, DataTransfer*);
169     void cancelDragAndDrop(const PlatformMouseEvent&, DataTransfer*);
170     bool performDragAndDrop(const PlatformMouseEvent&, DataTransfer*);
171     void updateDragStateAfterEditDragIfNeeded(Element* rootEditableElement);
172 #endif
173
174     void scheduleHoverStateUpdate();
175 #if ENABLE(CURSOR_SUPPORT)
176     void scheduleCursorUpdate();
177 #endif
178
179     void setResizingFrameSet(HTMLFrameSetElement*);
180
181     void resizeLayerDestroyed();
182
183     IntPoint lastKnownMousePosition() const;
184     IntPoint lastKnownMouseGlobalPosition() const { return m_lastKnownMouseGlobalPosition; }
185     Cursor currentMouseCursor() const { return m_currentMouseCursor; }
186
187     static Frame* subframeForTargetNode(Node*);
188     static Frame* subframeForHitTestResult(const MouseEventWithHitTestResults&);
189
190     WEBCORE_EXPORT bool scrollOverflow(ScrollDirection, ScrollGranularity, Node* startingNode = nullptr);
191     WEBCORE_EXPORT bool scrollRecursively(ScrollDirection, ScrollGranularity, Node* startingNode = nullptr);
192     WEBCORE_EXPORT bool logicalScrollRecursively(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = nullptr);
193
194     bool tabsToLinks(KeyboardEvent*) const;
195     bool tabsToAllFormControls(KeyboardEvent*) const;
196
197     WEBCORE_EXPORT bool mouseMoved(const PlatformMouseEvent&);
198     WEBCORE_EXPORT bool passMouseMovedEventToScrollbars(const PlatformMouseEvent&);
199
200     void lostMouseCapture();
201
202     WEBCORE_EXPORT bool handleMousePressEvent(const PlatformMouseEvent&);
203     bool handleMouseMoveEvent(const PlatformMouseEvent&, HitTestResult* hoveredNode = nullptr, bool onlyUpdateScrollbars = false);
204     WEBCORE_EXPORT bool handleMouseReleaseEvent(const PlatformMouseEvent&);
205     bool handleMouseForceEvent(const PlatformMouseEvent&);
206     WEBCORE_EXPORT bool handleWheelEvent(const PlatformWheelEvent&);
207     void defaultWheelEventHandler(Node*, WheelEvent*);
208     bool handlePasteGlobalSelection(const PlatformMouseEvent&);
209
210     void platformPrepareForWheelEvents(const PlatformWheelEvent&, const HitTestResult&, RefPtr<Element>& eventTarget, RefPtr<ContainerNode>& scrollableContainer, ScrollableArea*&, bool& isOverWidget);
211     void platformRecordWheelEvent(const PlatformWheelEvent&);
212     bool platformCompleteWheelEvent(const PlatformWheelEvent&, ContainerNode* scrollableContainer, ScrollableArea*);
213     bool platformCompletePlatformWidgetWheelEvent(const PlatformWheelEvent&, const Widget&, ContainerNode* scrollableContainer);
214     void platformNotifyIfEndGesture(const PlatformWheelEvent&, ScrollableArea*);
215
216 #if ENABLE(IOS_TOUCH_EVENTS) || ENABLE(IOS_GESTURE_EVENTS)
217     typedef Vector<RefPtr<Touch>> TouchArray;
218     typedef HashMap<EventTarget*, TouchArray*> EventTargetTouchMap;
219     typedef HashSet<RefPtr<EventTarget>> EventTargetSet;
220 #endif
221
222 #if ENABLE(IOS_TOUCH_EVENTS)
223     bool dispatchTouchEvent(const PlatformTouchEvent&, const AtomicString&, const EventTargetTouchMap&, float, float);
224     bool dispatchSimulatedTouchEvent(IntPoint location);
225 #endif
226
227 #if ENABLE(IOS_GESTURE_EVENTS)
228     bool dispatchGestureEvent(const PlatformTouchEvent&, const AtomicString&, const EventTargetSet&, float, float);
229 #endif
230
231 #if PLATFORM(IOS)
232     void defaultTouchEventHandler(Node*, TouchEvent*);
233 #endif
234
235 #if ENABLE(CONTEXT_MENUS)
236     WEBCORE_EXPORT bool sendContextMenuEvent(const PlatformMouseEvent&);
237     bool sendContextMenuEventForKey();
238 #endif
239
240     void setMouseDownMayStartAutoscroll() { m_mouseDownMayStartAutoscroll = true; }
241
242     bool needsKeyboardEventDisambiguationQuirks() const;
243
244     static unsigned accessKeyModifiers();
245     WEBCORE_EXPORT bool handleAccessKey(const PlatformKeyboardEvent&);
246     WEBCORE_EXPORT bool keyEvent(const PlatformKeyboardEvent&);
247     void defaultKeyboardEventHandler(KeyboardEvent*);
248
249     bool accessibilityPreventsEventPropogation(KeyboardEvent*);
250     WEBCORE_EXPORT void handleKeyboardSelectionMovementForAccessibility(KeyboardEvent*);
251
252     bool handleTextInputEvent(const String& text, Event* underlyingEvent = nullptr, TextEventInputType = TextEventInputKeyboard);
253     void defaultTextInputEventHandler(TextEvent*);
254
255 #if ENABLE(DRAG_SUPPORT)
256     WEBCORE_EXPORT bool eventMayStartDrag(const PlatformMouseEvent&) const;
257     
258     WEBCORE_EXPORT void dragSourceEndedAt(const PlatformMouseEvent&, DragOperation);
259 #endif
260
261     void focusDocumentView();
262     
263     WEBCORE_EXPORT void sendScrollEvent(); // Ditto
264
265 #if PLATFORM(COCOA) && defined(__OBJC__)
266 #if !PLATFORM(IOS)
267     WEBCORE_EXPORT void mouseDown(NSEvent *, NSEvent *correspondingPressureEvent);
268     WEBCORE_EXPORT void mouseDragged(NSEvent *, NSEvent *correspondingPressureEvent);
269     WEBCORE_EXPORT void mouseUp(NSEvent *, NSEvent *correspondingPressureEvent);
270     WEBCORE_EXPORT void mouseMoved(NSEvent *, NSEvent *correspondingPressureEvent);
271     WEBCORE_EXPORT void pressureChange(NSEvent *, NSEvent* correspondingPressureEvent);
272     WEBCORE_EXPORT bool keyEvent(NSEvent *);
273     WEBCORE_EXPORT bool wheelEvent(NSEvent *);
274 #else
275     WEBCORE_EXPORT void mouseDown(WebEvent *);
276     WEBCORE_EXPORT void mouseUp(WebEvent *);
277     WEBCORE_EXPORT void mouseMoved(WebEvent *);
278     WEBCORE_EXPORT bool keyEvent(WebEvent *);
279     WEBCORE_EXPORT bool wheelEvent(WebEvent *);
280 #endif
281
282 #if ENABLE(IOS_TOUCH_EVENTS)
283     WEBCORE_EXPORT void touchEvent(WebEvent *);
284 #endif
285
286 #if !PLATFORM(IOS)
287     WEBCORE_EXPORT void passMouseMovedEventToScrollbars(NSEvent *, NSEvent* correspondingPressureEvent);
288
289     WEBCORE_EXPORT void sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent);
290 #endif
291
292 #if !PLATFORM(IOS)
293     void setActivationEventNumber(int num) { m_activationEventNumber = num; }
294
295     WEBCORE_EXPORT static NSEvent *currentNSEvent();
296     static NSEvent *correspondingPressureEvent();
297 #else
298     static WebEvent *currentEvent();
299 #endif // !PLATFORM(IOS)
300 #endif // PLATFORM(COCOA) && defined(__OBJC__)
301
302 #if PLATFORM(IOS)
303     void invalidateClick();
304 #endif
305
306 #if ENABLE(TOUCH_EVENTS)
307     WEBCORE_EXPORT bool handleTouchEvent(const PlatformTouchEvent&);
308 #endif
309
310     bool useHandCursor(Node*, bool isOverLink, bool shiftKey);
311     void updateCursor();
312
313     bool isHandlingWheelEvent() const { return m_isHandlingWheelEvent; }
314
315     WEBCORE_EXPORT void setImmediateActionStage(ImmediateActionStage stage);
316
317 private:
318 #if ENABLE(DRAG_SUPPORT)
319     static DragState& dragState();
320     static const double TextDragDelay;
321     
322     PassRefPtr<DataTransfer> createDraggingDataTransfer() const;
323 #endif // ENABLE(DRAG_SUPPORT)
324
325     bool eventActivatedView(const PlatformMouseEvent&) const;
326     bool updateSelectionForMouseDownDispatchingSelectStart(Node*, const VisibleSelection&, TextGranularity);
327     void selectClosestWordFromHitTestResult(const HitTestResult&, AppendTrailingWhitespace);
328     VisibleSelection selectClosestWordFromHitTestResultBasedOnLookup(const HitTestResult&);
329     void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&);
330     void selectClosestContextualWordFromMouseEvent(const MouseEventWithHitTestResults&);
331     void selectClosestContextualWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults&);
332
333     bool handleMouseDoubleClickEvent(const PlatformMouseEvent&);
334
335     WEBCORE_EXPORT bool handleMousePressEvent(const MouseEventWithHitTestResults&);
336     bool handleMousePressEventSingleClick(const MouseEventWithHitTestResults&);
337     bool handleMousePressEventDoubleClick(const MouseEventWithHitTestResults&);
338     bool handleMousePressEventTripleClick(const MouseEventWithHitTestResults&);
339 #if ENABLE(DRAG_SUPPORT)
340     bool handleMouseDraggedEvent(const MouseEventWithHitTestResults&);
341 #endif
342     WEBCORE_EXPORT bool handleMouseReleaseEvent(const MouseEventWithHitTestResults&);
343
344     OptionalCursor selectCursor(const HitTestResult&, bool shiftKey);
345
346     void hoverTimerFired();
347 #if ENABLE(CURSOR_SUPPORT)
348     void cursorUpdateTimerFired();
349 #endif
350
351     bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = nullptr);
352     
353     bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const;
354     
355     bool mouseDownMayStartSelect() const { return m_mouseDownMayStartSelect; }
356
357     static bool isKeyboardOptionTab(KeyboardEvent*);
358     static bool eventInvertsTabsToLinksClientCallResult(KeyboardEvent*);
359
360 #if !ENABLE(IOS_TOUCH_EVENTS)
361     void fakeMouseMoveEventTimerFired();
362     void cancelFakeMouseMoveEvent();
363 #endif
364
365     bool isInsideScrollbar(const IntPoint&) const;
366
367 #if ENABLE(TOUCH_EVENTS)
368     bool dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent&);
369 #endif
370
371 #if !PLATFORM(IOS)
372     void invalidateClick();
373 #endif
374
375     Node* nodeUnderMouse() const;
376     
377     void updateMouseEventTargetNode(Node*, const PlatformMouseEvent&, bool fireMouseOverOut);
378     void fireMouseOverOut(bool fireMouseOver = true, bool fireMouseOut = true, bool updateLastNodeUnderMouse = true);
379     
380     MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const PlatformMouseEvent&);
381
382     bool dispatchMouseEvent(const AtomicString& eventType, Node* target, bool cancelable, int clickCount, const PlatformMouseEvent&, bool setUnder);
383 #if ENABLE(DRAG_SUPPORT)
384     bool dispatchDragEvent(const AtomicString& eventType, Element& target, const PlatformMouseEvent&, DataTransfer*);
385
386     void freeDataTransfer();
387
388     bool handleDrag(const MouseEventWithHitTestResults&, CheckDragHysteresis);
389 #endif
390     bool handleMouseUp(const MouseEventWithHitTestResults&);
391 #if ENABLE(DRAG_SUPPORT)
392     void clearDragState();
393
394     bool dispatchDragSrcEvent(const AtomicString& eventType, const PlatformMouseEvent&);
395
396     bool dragHysteresisExceeded(const FloatPoint&) const;
397     bool dragHysteresisExceeded(const IntPoint&) const;
398 #endif // ENABLE(DRAG_SUPPORT)
399     
400     bool mouseMovementExceedsThreshold(const FloatPoint&, int pointsThreshold) const;
401
402     bool passMousePressEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe);
403     bool passMouseMoveEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe, HitTestResult* hoveredNode = nullptr);
404     bool passMouseReleaseEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe);
405
406     bool passSubframeEventToSubframe(MouseEventWithHitTestResults&, Frame* subframe, HitTestResult* hoveredNode = nullptr);
407
408     bool passMousePressEventToScrollbar(MouseEventWithHitTestResults&, Scrollbar*);
409
410     bool passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&);
411     bool passWidgetMouseDownEventToWidget(RenderWidget*);
412
413     bool passMouseDownEventToWidget(Widget*);
414     bool passWheelEventToWidget(const PlatformWheelEvent&, Widget&);
415
416     void defaultSpaceEventHandler(KeyboardEvent*);
417     void defaultBackspaceEventHandler(KeyboardEvent*);
418     void defaultTabEventHandler(KeyboardEvent*);
419     void defaultArrowEventHandler(FocusDirection, KeyboardEvent*);
420
421 #if ENABLE(DRAG_SUPPORT)
422     DragSourceAction updateDragSourceActionsAllowed() const;
423 #endif
424
425     // The following are called at the beginning of handleMouseUp and handleDrag.  
426     // If they return true it indicates that they have consumed the event.
427     bool eventLoopHandleMouseUp(const MouseEventWithHitTestResults&);
428 #if ENABLE(DRAG_SUPPORT)
429     bool eventLoopHandleMouseDragged(const MouseEventWithHitTestResults&);
430 #endif
431
432 #if ENABLE(DRAG_SUPPORT)
433     void updateSelectionForMouseDrag(const HitTestResult&);
434 #endif
435
436     void updateLastScrollbarUnderMouse(Scrollbar*, bool);
437     
438     void setFrameWasScrolledByUser();
439
440     bool capturesDragging() const { return m_capturesDragging; }
441
442 #if PLATFORM(COCOA) && defined(__OBJC__)
443     NSView *mouseDownViewIfStillGood();
444
445     PlatformMouseEvent currentPlatformMouseEvent() const;
446 #endif
447
448 #if ENABLE(FULLSCREEN_API)
449     bool isKeyEventAllowedInFullScreen(const PlatformKeyboardEvent&) const;
450 #endif
451
452     void setLastKnownMousePosition(const PlatformMouseEvent&);
453
454 #if ENABLE(CURSOR_VISIBILITY)
455     void startAutoHideCursorTimer();
456     void cancelAutoHideCursorTimer();
457     void autoHideCursorTimerFired();
458 #endif
459
460     void beginTrackingPotentialLongMousePress(const HitTestResult&);
461     void recognizeLongMousePress();
462     void cancelTrackingPotentialLongMousePress();
463     bool longMousePressHysteresisExceeded();
464     void clearLongMousePressState();
465     bool handleLongMousePressMouseMovedEvent(const PlatformMouseEvent&);
466
467     void clearLatchedState();
468
469     Frame& m_frame;
470
471     bool m_mousePressed;
472     bool m_capturesDragging;
473     RefPtr<Node> m_mousePressNode;
474
475     bool m_mouseDownMayStartSelect;
476 #if ENABLE(DRAG_SUPPORT)
477     bool m_mouseDownMayStartDrag;
478     bool m_dragMayStartSelectionInstead;
479 #endif
480     bool m_mouseDownWasSingleClickInSelection;
481     enum SelectionInitiationState { HaveNotStartedSelection, PlacedCaret, ExtendedSelection };
482     SelectionInitiationState m_selectionInitiationState;
483
484 #if ENABLE(DRAG_SUPPORT)
485     LayoutPoint m_dragStartPos;
486 #endif
487
488     bool m_panScrollButtonPressed;
489
490     Timer m_hoverTimer;
491 #if ENABLE(CURSOR_SUPPORT)
492     Timer m_cursorUpdateTimer;
493 #endif
494
495     Timer m_longMousePressTimer;
496     bool m_didRecognizeLongMousePress;
497
498     std::unique_ptr<AutoscrollController> m_autoscrollController;
499     bool m_mouseDownMayStartAutoscroll;
500     bool m_mouseDownWasInSubframe;
501
502 #if !ENABLE(IOS_TOUCH_EVENTS)
503     Timer m_fakeMouseMoveEventTimer;
504 #endif
505
506     bool m_svgPan;
507
508     RenderLayer* m_resizeLayer;
509
510     RefPtr<Element> m_capturingMouseEventsElement;
511     bool m_eventHandlerWillResetCapturingMouseEventsElement;
512     
513     RefPtr<Element> m_elementUnderMouse;
514     RefPtr<Element> m_lastElementUnderMouse;
515     RefPtr<Frame> m_lastMouseMoveEventSubframe;
516     WeakPtr<Scrollbar> m_lastScrollbarUnderMouse;
517     Cursor m_currentMouseCursor;
518
519     int m_clickCount;
520     RefPtr<Node> m_clickNode;
521
522 #if ENABLE(IOS_GESTURE_EVENTS)
523     float m_gestureInitialDiameter;
524     float m_gestureLastDiameter;
525     float m_gestureInitialRotation;
526     float m_gestureLastRotation;
527 #endif
528
529 #if ENABLE(IOS_TOUCH_EVENTS)
530     unsigned m_firstTouchID;
531
532     TouchArray m_touches;
533     EventTargetSet m_gestureTargets;
534     RefPtr<Frame> m_touchEventTargetSubframe;
535 #endif
536
537 #if ENABLE(DRAG_SUPPORT)
538     RefPtr<Element> m_dragTarget;
539     bool m_shouldOnlyFireDragOverEvent;
540 #endif
541     
542     RefPtr<HTMLFrameSetElement> m_frameSetBeingResized;
543
544     LayoutSize m_offsetFromResizeCorner; // In the coords of m_resizeLayer.
545     
546     bool m_mousePositionIsUnknown;
547     IntPoint m_lastKnownMousePosition;
548     IntPoint m_lastKnownMouseGlobalPosition;
549     IntPoint m_mouseDownPos; // In our view's coords.
550     double m_mouseDownTimestamp;
551     PlatformMouseEvent m_mouseDown;
552
553 #if PLATFORM(COCOA)
554     NSView *m_mouseDownView;
555     bool m_sendingEventToSubview;
556     bool m_startedGestureAtScrollLimit;
557 #if !PLATFORM(IOS)
558     int m_activationEventNumber;
559 #endif
560 #endif
561 #if ENABLE(TOUCH_EVENTS) && !ENABLE(IOS_TOUCH_EVENTS)
562     typedef HashMap<int, RefPtr<EventTarget>> TouchTargetMap;
563     TouchTargetMap m_originatingTouchPointTargets;
564     RefPtr<Document> m_originatingTouchPointDocument;
565     unsigned m_originatingTouchPointTargetKey;
566     bool m_touchPressed;
567 #endif
568
569     double m_maxMouseMovedDuration;
570     PlatformEvent::Type m_baseEventType;
571     bool m_didStartDrag;
572     bool m_didLongPressInvokeContextMenu;
573     bool m_isHandlingWheelEvent;
574
575 #if ENABLE(CURSOR_VISIBILITY)
576     Timer m_autoHideCursorTimer;
577 #endif
578
579     ImmediateActionStage m_immediateActionStage;
580 };
581
582 } // namespace WebCore
583
584 #endif // EventHandler_h