OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "RenderWidget.h" | 75 #include "RenderWidget.h" |
76 #include "ScrollAnimator.h" | 76 #include "ScrollAnimator.h" |
77 #include "Scrollbar.h" | 77 #include "Scrollbar.h" |
78 #include "Settings.h" | 78 #include "Settings.h" |
79 #include "ShadowRoot.h" | 79 #include "ShadowRoot.h" |
80 #include "SpatialNavigation.h" | 80 #include "SpatialNavigation.h" |
81 #include "StaticHashSetNodeList.h" | 81 #include "StaticHashSetNodeList.h" |
82 #include "StyleCachedImage.h" | 82 #include "StyleCachedImage.h" |
83 #include "TextEvent.h" | 83 #include "TextEvent.h" |
84 #include "TextIterator.h" | 84 #include "TextIterator.h" |
85 #include "UserGestureIndicator.h" | |
86 #include "UserTypingGestureIndicator.h" | 85 #include "UserTypingGestureIndicator.h" |
87 #include "WheelEvent.h" | 86 #include "WheelEvent.h" |
88 #include "WindowsKeyboardCodes.h" | 87 #include "WindowsKeyboardCodes.h" |
89 #include <wtf/Assertions.h> | 88 #include <wtf/Assertions.h> |
90 #include <wtf/CurrentTime.h> | 89 #include <wtf/CurrentTime.h> |
91 #include <wtf/StdLibExtras.h> | 90 #include <wtf/StdLibExtras.h> |
92 #include <wtf/TemporaryChange.h> | 91 #include <wtf/TemporaryChange.h> |
93 | 92 |
94 #if ENABLE(GESTURE_EVENTS) | 93 #if ENABLE(GESTURE_EVENTS) |
95 #include "PlatformGestureEvent.h" | 94 #include "PlatformGestureEvent.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 m_clickCount = 0; | 375 m_clickCount = 0; |
377 m_clickNode = 0; | 376 m_clickNode = 0; |
378 m_frameSetBeingResized = 0; | 377 m_frameSetBeingResized = 0; |
379 #if ENABLE(DRAG_SUPPORT) | 378 #if ENABLE(DRAG_SUPPORT) |
380 m_dragTarget = 0; | 379 m_dragTarget = 0; |
381 m_shouldOnlyFireDragOverEvent = false; | 380 m_shouldOnlyFireDragOverEvent = false; |
382 #endif | 381 #endif |
383 m_mousePositionIsUnknown = true; | 382 m_mousePositionIsUnknown = true; |
384 m_lastKnownMousePosition = IntPoint(); | 383 m_lastKnownMousePosition = IntPoint(); |
385 m_lastKnownMouseGlobalPosition = IntPoint(); | 384 m_lastKnownMouseGlobalPosition = IntPoint(); |
| 385 m_lastMouseDownUserGestureToken.clear(); |
386 m_mousePressNode = 0; | 386 m_mousePressNode = 0; |
387 m_mousePressed = false; | 387 m_mousePressed = false; |
388 m_capturesDragging = false; | 388 m_capturesDragging = false; |
389 m_capturingMouseEventsNode = 0; | 389 m_capturingMouseEventsNode = 0; |
390 m_latchedWheelEventNode = 0; | 390 m_latchedWheelEventNode = 0; |
391 m_previousWheelScrolledNode = 0; | 391 m_previousWheelScrolledNode = 0; |
392 #if ENABLE(TOUCH_EVENTS) | 392 #if ENABLE(TOUCH_EVENTS) |
393 m_originatingTouchPointTargets.clear(); | 393 m_originatingTouchPointTargets.clear(); |
394 m_originatingTouchPointDocument.clear(); | 394 m_originatingTouchPointDocument.clear(); |
395 m_originatingTouchPointTargetKey = 0; | 395 m_originatingTouchPointTargetKey = 0; |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 return true; | 1415 return true; |
1416 } | 1416 } |
1417 | 1417 |
1418 #if ENABLE(TOUCH_EVENTS) | 1418 #if ENABLE(TOUCH_EVENTS) |
1419 bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent); | 1419 bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent); |
1420 if (defaultPrevented) | 1420 if (defaultPrevented) |
1421 return true; | 1421 return true; |
1422 #endif | 1422 #endif |
1423 | 1423 |
1424 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); | 1424 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); |
| 1425 m_lastMouseDownUserGestureToken = gestureIndicator.currentToken(); |
1425 | 1426 |
1426 // FIXME (bug 68185): this call should be made at another abstraction layer | 1427 // FIXME (bug 68185): this call should be made at another abstraction layer |
1427 m_frame->loader()->resetMultipleFormSubmissionProtection(); | 1428 m_frame->loader()->resetMultipleFormSubmissionProtection(); |
1428 | 1429 |
1429 cancelFakeMouseMoveEvent(); | 1430 cancelFakeMouseMoveEvent(); |
1430 m_mousePressed = true; | 1431 m_mousePressed = true; |
1431 m_capturesDragging = true; | 1432 m_capturesDragging = true; |
1432 setLastKnownMousePosition(mouseEvent); | 1433 setLastKnownMousePosition(mouseEvent); |
1433 m_mouseDownTimestamp = mouseEvent.timestamp(); | 1434 m_mouseDownTimestamp = mouseEvent.timestamp(); |
1434 #if ENABLE(DRAG_SUPPORT) | 1435 #if ENABLE(DRAG_SUPPORT) |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1759 bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent) | 1760 bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent) |
1760 { | 1761 { |
1761 RefPtr<FrameView> protector(m_frame->view()); | 1762 RefPtr<FrameView> protector(m_frame->view()); |
1762 | 1763 |
1763 #if ENABLE(TOUCH_EVENTS) | 1764 #if ENABLE(TOUCH_EVENTS) |
1764 bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent); | 1765 bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent); |
1765 if (defaultPrevented) | 1766 if (defaultPrevented) |
1766 return true; | 1767 return true; |
1767 #endif | 1768 #endif |
1768 | 1769 |
1769 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); | 1770 OwnPtr<UserGestureIndicator> gestureIndicator; |
| 1771 |
| 1772 if (m_lastMouseDownUserGestureToken) |
| 1773 gestureIndicator = adoptPtr(new UserGestureIndicator(m_lastMouseDownUser
GestureToken.release())); |
| 1774 else |
| 1775 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin
gUserGesture)); |
1770 | 1776 |
1771 #if ENABLE(PAN_SCROLLING) | 1777 #if ENABLE(PAN_SCROLLING) |
1772 m_autoscrollController->handleMouseReleaseEvent(mouseEvent); | 1778 m_autoscrollController->handleMouseReleaseEvent(mouseEvent); |
1773 #endif | 1779 #endif |
1774 | 1780 |
1775 m_mousePressed = false; | 1781 m_mousePressed = false; |
1776 setLastKnownMousePosition(mouseEvent); | 1782 setLastKnownMousePosition(mouseEvent); |
1777 | 1783 |
1778 #if ENABLE(SVG) | 1784 #if ENABLE(SVG) |
1779 if (m_svgPan) { | 1785 if (m_svgPan) { |
(...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3892 #endif | 3898 #endif |
3893 | 3899 |
3894 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) | 3900 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) |
3895 { | 3901 { |
3896 m_mousePositionIsUnknown = false; | 3902 m_mousePositionIsUnknown = false; |
3897 m_lastKnownMousePosition = event.position(); | 3903 m_lastKnownMousePosition = event.position(); |
3898 m_lastKnownMouseGlobalPosition = event.globalPosition(); | 3904 m_lastKnownMouseGlobalPosition = event.globalPosition(); |
3899 } | 3905 } |
3900 | 3906 |
3901 } // namespace WebCore | 3907 } // namespace WebCore |
OLD | NEW |