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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 invalidateClick(); | 1421 invalidateClick(); |
1422 return true; | 1422 return true; |
1423 } | 1423 } |
1424 | 1424 |
1425 #if ENABLE(TOUCH_EVENTS) | 1425 #if ENABLE(TOUCH_EVENTS) |
1426 bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent); | 1426 bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent); |
1427 if (defaultPrevented) | 1427 if (defaultPrevented) |
1428 return true; | 1428 return true; |
1429 #endif | 1429 #endif |
1430 | 1430 |
1431 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 1431 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); |
1432 m_lastMouseDownUserGestureToken = gestureIndicator.currentToken(); | 1432 m_lastMouseDownUserGestureToken = gestureIndicator.currentToken(); |
1433 | 1433 |
1434 // FIXME (bug 68185): this call should be made at another abstraction layer | 1434 // FIXME (bug 68185): this call should be made at another abstraction layer |
1435 m_frame->loader()->resetMultipleFormSubmissionProtection(); | 1435 m_frame->loader()->resetMultipleFormSubmissionProtection(); |
1436 | 1436 |
1437 cancelFakeMouseMoveEvent(); | 1437 cancelFakeMouseMoveEvent(); |
1438 m_mousePressed = true; | 1438 m_mousePressed = true; |
1439 m_capturesDragging = true; | 1439 m_capturesDragging = true; |
1440 setLastKnownMousePosition(mouseEvent); | 1440 setLastKnownMousePosition(mouseEvent); |
1441 m_mouseDownTimestamp = mouseEvent.timestamp(); | 1441 m_mouseDownTimestamp = mouseEvent.timestamp(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1555 return swallowEvent; | 1555 return swallowEvent; |
1556 } | 1556 } |
1557 | 1557 |
1558 // This method only exists for platforms that don't know how to deliver | 1558 // This method only exists for platforms that don't know how to deliver |
1559 bool EventHandler::handleMouseDoubleClickEvent(const PlatformMouseEvent& mouseEv
ent) | 1559 bool EventHandler::handleMouseDoubleClickEvent(const PlatformMouseEvent& mouseEv
ent) |
1560 { | 1560 { |
1561 RefPtr<FrameView> protector(m_frame->view()); | 1561 RefPtr<FrameView> protector(m_frame->view()); |
1562 | 1562 |
1563 m_frame->selection()->setCaretBlinkingSuspended(false); | 1563 m_frame->selection()->setCaretBlinkingSuspended(false); |
1564 | 1564 |
1565 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 1565 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); |
1566 | 1566 |
1567 // We get this instead of a second mouse-up | 1567 // We get this instead of a second mouse-up |
1568 m_mousePressed = false; | 1568 m_mousePressed = false; |
1569 setLastKnownMousePosition(mouseEvent); | 1569 setLastKnownMousePosition(mouseEvent); |
1570 | 1570 |
1571 HitTestRequest request(HitTestRequest::Active); | 1571 HitTestRequest request(HitTestRequest::Active); |
1572 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent); | 1572 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent); |
1573 Frame* subframe = subframeForHitTestResult(mev); | 1573 Frame* subframe = subframeForHitTestResult(mev); |
1574 if (m_eventHandlerWillResetCapturingMouseEventsNode) | 1574 if (m_eventHandlerWillResetCapturingMouseEventsNode) |
1575 m_capturingMouseEventsNode = 0; | 1575 m_capturingMouseEventsNode = 0; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent); | 1798 bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent); |
1799 if (defaultPrevented) | 1799 if (defaultPrevented) |
1800 return true; | 1800 return true; |
1801 #endif | 1801 #endif |
1802 | 1802 |
1803 OwnPtr<UserGestureIndicator> gestureIndicator; | 1803 OwnPtr<UserGestureIndicator> gestureIndicator; |
1804 | 1804 |
1805 if (m_lastMouseDownUserGestureToken) | 1805 if (m_lastMouseDownUserGestureToken) |
1806 gestureIndicator = adoptPtr(new UserGestureIndicator(m_lastMouseDownUser
GestureToken.release())); | 1806 gestureIndicator = adoptPtr(new UserGestureIndicator(m_lastMouseDownUser
GestureToken.release())); |
1807 else | 1807 else |
1808 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin
gNewUserGesture)); | 1808 gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessin
gUserGesture)); |
1809 | 1809 |
1810 #if ENABLE(PAN_SCROLLING) | 1810 #if ENABLE(PAN_SCROLLING) |
1811 m_autoscrollController->handleMouseReleaseEvent(mouseEvent); | 1811 m_autoscrollController->handleMouseReleaseEvent(mouseEvent); |
1812 #endif | 1812 #endif |
1813 | 1813 |
1814 m_mousePressed = false; | 1814 m_mousePressed = false; |
1815 setLastKnownMousePosition(mouseEvent); | 1815 setLastKnownMousePosition(mouseEvent); |
1816 | 1816 |
1817 #if ENABLE(SVG) | 1817 #if ENABLE(SVG) |
1818 if (m_svgPan) { | 1818 if (m_svgPan) { |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3126 } | 3126 } |
3127 } | 3127 } |
3128 #endif | 3128 #endif |
3129 | 3129 |
3130 // Check for cases where we are too early for events -- possible unmatched k
ey up | 3130 // Check for cases where we are too early for events -- possible unmatched k
ey up |
3131 // from pressing return in the location bar. | 3131 // from pressing return in the location bar. |
3132 RefPtr<Node> node = eventTargetNodeForDocument(m_frame->document()); | 3132 RefPtr<Node> node = eventTargetNodeForDocument(m_frame->document()); |
3133 if (!node) | 3133 if (!node) |
3134 return false; | 3134 return false; |
3135 | 3135 |
3136 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 3136 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); |
3137 UserTypingGestureIndicator typingGestureIndicator(m_frame); | 3137 UserTypingGestureIndicator typingGestureIndicator(m_frame); |
3138 | 3138 |
3139 if (FrameView* view = m_frame->view()) | 3139 if (FrameView* view = m_frame->view()) |
3140 view->resetDeferredRepaintDelay(); | 3140 view->resetDeferredRepaintDelay(); |
3141 | 3141 |
3142 // FIXME (bug 68185): this call should be made at another abstraction layer | 3142 // FIXME (bug 68185): this call should be made at another abstraction layer |
3143 m_frame->loader()->resetMultipleFormSubmissionProtection(); | 3143 m_frame->loader()->resetMultipleFormSubmissionProtection(); |
3144 | 3144 |
3145 // In IE, access keys are special, they are handled after default keydown pr
ocessing, but cannot be canceled - this is hard to match. | 3145 // In IE, access keys are special, they are handled after default keydown pr
ocessing, but cannot be canceled - this is hard to match. |
3146 // On Mac OS X, we process them before dispatching keydown, as the default k
eydown handler implements Emacs key bindings, which may conflict | 3146 // On Mac OS X, we process them before dispatching keydown, as the default k
eydown handler implements Emacs key bindings, which may conflict |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3824 typedef HashSet<RefPtr<EventTarget> > EventTargetSet; | 3824 typedef HashSet<RefPtr<EventTarget> > EventTargetSet; |
3825 struct { | 3825 struct { |
3826 // The touches corresponding to the particular change state this struct
instance represents. | 3826 // The touches corresponding to the particular change state this struct
instance represents. |
3827 RefPtr<TouchList> m_touches; | 3827 RefPtr<TouchList> m_touches; |
3828 // Set of targets involved in m_touches. | 3828 // Set of targets involved in m_touches. |
3829 EventTargetSet m_targets; | 3829 EventTargetSet m_targets; |
3830 } changedTouches[PlatformTouchPoint::TouchStateEnd]; | 3830 } changedTouches[PlatformTouchPoint::TouchStateEnd]; |
3831 | 3831 |
3832 const Vector<PlatformTouchPoint>& points = event.touchPoints(); | 3832 const Vector<PlatformTouchPoint>& points = event.touchPoints(); |
3833 | 3833 |
3834 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 3834 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); |
3835 | 3835 |
3836 unsigned i; | 3836 unsigned i; |
3837 bool freshTouchEvents = true; | 3837 bool freshTouchEvents = true; |
3838 bool allTouchReleased = true; | 3838 bool allTouchReleased = true; |
3839 for (i = 0; i < points.size(); ++i) { | 3839 for (i = 0; i < points.size(); ++i) { |
3840 const PlatformTouchPoint& point = points[i]; | 3840 const PlatformTouchPoint& point = points[i]; |
3841 if (point.state() != PlatformTouchPoint::TouchPressed) | 3841 if (point.state() != PlatformTouchPoint::TouchPressed) |
3842 freshTouchEvents = false; | 3842 freshTouchEvents = false; |
3843 if (point.state() != PlatformTouchPoint::TouchReleased && point.state()
!= PlatformTouchPoint::TouchCancelled) | 3843 if (point.state() != PlatformTouchPoint::TouchReleased && point.state()
!= PlatformTouchPoint::TouchCancelled) |
3844 allTouchReleased = false; | 3844 allTouchReleased = false; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4046 #endif | 4046 #endif |
4047 | 4047 |
4048 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) | 4048 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) |
4049 { | 4049 { |
4050 m_mousePositionIsUnknown = false; | 4050 m_mousePositionIsUnknown = false; |
4051 m_lastKnownMousePosition = event.position(); | 4051 m_lastKnownMousePosition = event.position(); |
4052 m_lastKnownMouseGlobalPosition = event.globalPosition(); | 4052 m_lastKnownMouseGlobalPosition = event.globalPosition(); |
4053 } | 4053 } |
4054 | 4054 |
4055 } // namespace WebCore | 4055 } // namespace WebCore |
OLD | NEW |