OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 10 matching lines...) Expand all Loading... |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef EventHandler_h | 26 #ifndef EventHandler_h |
27 #define EventHandler_h | 27 #define EventHandler_h |
28 | 28 |
29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
30 #include "core/editing/TextGranularity.h" | 30 #include "core/editing/TextGranularity.h" |
| 31 #include "core/events/PointerEventUtils.h" |
31 #include "core/events/TextEventInputType.h" | 32 #include "core/events/TextEventInputType.h" |
32 #include "core/layout/HitTestRequest.h" | 33 #include "core/layout/HitTestRequest.h" |
33 #include "core/style/ComputedStyleConstants.h" | 34 #include "core/style/ComputedStyleConstants.h" |
34 #include "core/page/DragActions.h" | 35 #include "core/page/DragActions.h" |
35 #include "core/page/EventWithHitTestResults.h" | 36 #include "core/page/EventWithHitTestResults.h" |
36 #include "platform/Cursor.h" | 37 #include "platform/Cursor.h" |
37 #include "platform/PlatformMouseEvent.h" | 38 #include "platform/PlatformMouseEvent.h" |
| 39 #include "platform/PlatformTouchPoint.h" |
38 #include "platform/Timer.h" | 40 #include "platform/Timer.h" |
39 #include "platform/UserGestureIndicator.h" | 41 #include "platform/UserGestureIndicator.h" |
40 #include "platform/geometry/LayoutPoint.h" | 42 #include "platform/geometry/LayoutPoint.h" |
41 #include "platform/heap/Handle.h" | 43 #include "platform/heap/Handle.h" |
42 #include "platform/scroll/ScrollTypes.h" | 44 #include "platform/scroll/ScrollTypes.h" |
43 #include "public/platform/WebFocusType.h" | 45 #include "public/platform/WebFocusType.h" |
44 #include "wtf/Forward.h" | 46 #include "wtf/Forward.h" |
45 #include "wtf/HashMap.h" | 47 #include "wtf/HashMap.h" |
46 #include "wtf/HashTraits.h" | 48 #include "wtf/HashTraits.h" |
47 #include "wtf/RefPtr.h" | 49 #include "wtf/RefPtr.h" |
(...skipping 10 matching lines...) Expand all Loading... |
58 class Event; | 60 class Event; |
59 class EventTarget; | 61 class EventTarget; |
60 template <typename EventType> | 62 template <typename EventType> |
61 class EventWithHitTestResults; | 63 class EventWithHitTestResults; |
62 class FloatPoint; | 64 class FloatPoint; |
63 class FloatQuad; | 65 class FloatQuad; |
64 class HTMLFrameSetElement; | 66 class HTMLFrameSetElement; |
65 class HitTestRequest; | 67 class HitTestRequest; |
66 class HitTestResult; | 68 class HitTestResult; |
67 class KeyboardEvent; | 69 class KeyboardEvent; |
| 70 class LayoutObject; |
68 class LocalFrame; | 71 class LocalFrame; |
69 class Node; | 72 class Node; |
70 class OptionalCursor; | 73 class OptionalCursor; |
71 class PlatformGestureEvent; | 74 class PlatformGestureEvent; |
72 class PlatformKeyboardEvent; | 75 class PlatformKeyboardEvent; |
73 class PlatformTouchEvent; | 76 class PlatformTouchEvent; |
74 class PlatformWheelEvent; | 77 class PlatformWheelEvent; |
75 class LayoutObject; | |
76 class ScrollableArea; | 78 class ScrollableArea; |
77 class Scrollbar; | 79 class Scrollbar; |
78 class ScrollState; | 80 class ScrollState; |
79 class TextEvent; | 81 class TextEvent; |
80 class VisibleSelection; | 82 class VisibleSelection; |
81 class WheelEvent; | 83 class WheelEvent; |
82 class Widget; | 84 class Widget; |
83 | 85 |
84 enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTraili
ngWhitespace }; | 86 enum AppendTrailingWhitespace { ShouldAppendTrailingWhitespace, DontAppendTraili
ngWhitespace }; |
85 enum class DragInitiator; | 87 enum class DragInitiator; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 AutoscrollController* autoscrollController() const; | 324 AutoscrollController* autoscrollController() const; |
323 bool panScrollInProgress() const; | 325 bool panScrollInProgress() const; |
324 void setLastKnownMousePosition(const PlatformMouseEvent&); | 326 void setLastKnownMousePosition(const PlatformMouseEvent&); |
325 | 327 |
326 bool shouldTopControlsConsumeScroll(FloatSize) const; | 328 bool shouldTopControlsConsumeScroll(FloatSize) const; |
327 | 329 |
328 // If the given element is a shadow host with tabStop = false, slide focus t
o its inner | 330 // If the given element is a shadow host with tabStop = false, slide focus t
o its inner |
329 // element. Returns true if the resulting focus is different from the given
element. | 331 // element. Returns true if the resulting focus is different from the given
element. |
330 bool slideFocusOnShadowHostIfNecessary(const Element&); | 332 bool slideFocusOnShadowHostIfNecessary(const Element&); |
331 | 333 |
| 334 using TouchInfo = struct { |
| 335 EventTarget* touchTarget; |
| 336 LocalFrame* targetFrame; |
| 337 FloatPoint adjustedPagePoint; |
| 338 FloatSize adjustedRadius; |
| 339 bool knownTarget; |
| 340 bool consumed; |
| 341 }; |
| 342 |
| 343 void handlePointerEventsFromTouchEvent(const PlatformTouchEvent&, const Vect
or<PlatformTouchPoint>&, Vector<TouchInfo>&); |
| 344 |
332 // NOTE: If adding a new field to this class please ensure that it is | 345 // NOTE: If adding a new field to this class please ensure that it is |
333 // cleared in |EventHandler::clear()|. | 346 // cleared in |EventHandler::clear()|. |
334 | 347 |
335 LocalFrame* const m_frame; | 348 LocalFrame* const m_frame; |
336 | 349 |
337 bool m_mousePressed; | 350 bool m_mousePressed; |
338 bool m_capturesDragging; | 351 bool m_capturesDragging; |
339 RefPtrWillBeMember<Node> m_mousePressNode; | 352 RefPtrWillBeMember<Node> m_mousePressNode; |
340 | 353 |
341 bool m_mouseDownMayStartSelect; | 354 bool m_mouseDownMayStartSelect; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 // The target of each active touch point indexed by the touch ID. | 408 // The target of each active touch point indexed by the touch ID. |
396 using TouchTargetMap = WillBeHeapHashMap<unsigned, RefPtrWillBeMember<EventT
arget>, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned
>>; | 409 using TouchTargetMap = WillBeHeapHashMap<unsigned, RefPtrWillBeMember<EventT
arget>, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned
>>; |
397 TouchTargetMap m_targetForTouchID; | 410 TouchTargetMap m_targetForTouchID; |
398 | 411 |
399 // If set, the document of the active touch sequence. Unset if no touch sequ
ence active. | 412 // If set, the document of the active touch sequence. Unset if no touch sequ
ence active. |
400 RefPtrWillBeMember<Document> m_touchSequenceDocument; | 413 RefPtrWillBeMember<Document> m_touchSequenceDocument; |
401 RefPtr<UserGestureToken> m_touchSequenceUserGestureToken; | 414 RefPtr<UserGestureToken> m_touchSequenceUserGestureToken; |
402 | 415 |
403 bool m_touchPressed; | 416 bool m_touchPressed; |
404 | 417 |
| 418 PointerIdManager m_pointerIdManager; |
| 419 |
405 RefPtrWillBeMember<Node> m_scrollGestureHandlingNode; | 420 RefPtrWillBeMember<Node> m_scrollGestureHandlingNode; |
406 bool m_lastGestureScrollOverWidget; | 421 bool m_lastGestureScrollOverWidget; |
407 // The most recent element to scroll natively during this scroll | 422 // The most recent element to scroll natively during this scroll |
408 // sequence. Null if no native element has scrolled this scroll | 423 // sequence. Null if no native element has scrolled this scroll |
409 // sequence, or if the most recent element to scroll used scroll | 424 // sequence, or if the most recent element to scroll used scroll |
410 // customization. | 425 // customization. |
411 RefPtrWillBeMember<Node> m_previousGestureScrolledNode; | 426 RefPtrWillBeMember<Node> m_previousGestureScrolledNode; |
412 RefPtrWillBeMember<Scrollbar> m_scrollbarHandlingScrollGesture; | 427 RefPtrWillBeMember<Scrollbar> m_scrollbarHandlingScrollGesture; |
413 | 428 |
414 double m_maxMouseMovedDuration; | 429 double m_maxMouseMovedDuration; |
(...skipping 10 matching lines...) Expand all Loading... |
425 // scroll sequence in this frame, or any child frames. Only used | 440 // scroll sequence in this frame, or any child frames. Only used |
426 // with ScrollCustomization. If some delta has been consumed, a | 441 // with ScrollCustomization. If some delta has been consumed, a |
427 // scroll which shouldn't propagate can't cause any element to | 442 // scroll which shouldn't propagate can't cause any element to |
428 // scroll other than the |m_previousGestureScrolledNode|. | 443 // scroll other than the |m_previousGestureScrolledNode|. |
429 bool m_deltaConsumedForScrollSequence; | 444 bool m_deltaConsumedForScrollSequence; |
430 }; | 445 }; |
431 | 446 |
432 } // namespace blink | 447 } // namespace blink |
433 | 448 |
434 #endif // EventHandler_h | 449 #endif // EventHandler_h |
OLD | NEW |