| 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 2302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2313 } | 2313 } |
| 2314 else | 2314 else |
| 2315 hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly; | 2315 hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly; |
| 2316 | 2316 |
| 2317 if ((!scrollbar && !eventTarget) || !(hitType & HitTestRequest::ReadOnly)) { | 2317 if ((!scrollbar && !eventTarget) || !(hitType & HitTestRequest::ReadOnly)) { |
| 2318 IntPoint hitTestPoint = m_frame->view()->windowToContents(adjustedPoint)
; | 2318 IntPoint hitTestPoint = m_frame->view()->windowToContents(adjustedPoint)
; |
| 2319 HitTestResult result = hitTestResultAtPoint(hitTestPoint, hitType | HitT
estRequest::AllowFrameScrollbars); | 2319 HitTestResult result = hitTestResultAtPoint(hitTestPoint, hitType | HitT
estRequest::AllowFrameScrollbars); |
| 2320 | 2320 |
| 2321 if (shouldKeepActiveForMinInterval) { | 2321 if (shouldKeepActiveForMinInterval) { |
| 2322 m_lastDeferredTapElement = result.innerElement(); | 2322 m_lastDeferredTapElement = result.innerElement(); |
| 2323 m_activeIntervalTimer.startOneShot(minimumActiveInterval - activeInt
erval); | 2323 m_activeIntervalTimer.startOneShot(minimumActiveInterval - activeInt
erval, FROM_HERE); |
| 2324 } | 2324 } |
| 2325 | 2325 |
| 2326 eventTarget = result.targetNode(); | 2326 eventTarget = result.targetNode(); |
| 2327 if (!scrollbar) { | 2327 if (!scrollbar) { |
| 2328 FrameView* view = m_frame->view(); | 2328 FrameView* view = m_frame->view(); |
| 2329 scrollbar = view ? view->scrollbarAtPoint(gestureEvent.position()) :
0; | 2329 scrollbar = view ? view->scrollbarAtPoint(gestureEvent.position()) :
0; |
| 2330 } | 2330 } |
| 2331 if (!scrollbar) | 2331 if (!scrollbar) |
| 2332 scrollbar = result.scrollbar(); | 2332 scrollbar = result.scrollbar(); |
| 2333 } | 2333 } |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2885 // context menu event. | 2885 // context menu event. |
| 2886 handleMousePressEvent(mouseEvent); | 2886 handleMousePressEvent(mouseEvent); |
| 2887 return sendContextMenuEvent(mouseEvent); | 2887 return sendContextMenuEvent(mouseEvent); |
| 2888 // We do not need to send a corresponding mouse release because in case of | 2888 // We do not need to send a corresponding mouse release because in case of |
| 2889 // right-click, the context menu takes capture and consumes all events. | 2889 // right-click, the context menu takes capture and consumes all events. |
| 2890 } | 2890 } |
| 2891 | 2891 |
| 2892 void EventHandler::scheduleHoverStateUpdate() | 2892 void EventHandler::scheduleHoverStateUpdate() |
| 2893 { | 2893 { |
| 2894 if (!m_hoverTimer.isActive()) | 2894 if (!m_hoverTimer.isActive()) |
| 2895 m_hoverTimer.startOneShot(0); | 2895 m_hoverTimer.startOneShot(0, FROM_HERE); |
| 2896 } | 2896 } |
| 2897 | 2897 |
| 2898 void EventHandler::scheduleCursorUpdate() | 2898 void EventHandler::scheduleCursorUpdate() |
| 2899 { | 2899 { |
| 2900 if (!m_cursorUpdateTimer.isActive()) | 2900 if (!m_cursorUpdateTimer.isActive()) |
| 2901 m_cursorUpdateTimer.startOneShot(cursorUpdateInterval); | 2901 m_cursorUpdateTimer.startOneShot(cursorUpdateInterval, FROM_HERE); |
| 2902 } | 2902 } |
| 2903 | 2903 |
| 2904 void EventHandler::dispatchFakeMouseMoveEventSoon() | 2904 void EventHandler::dispatchFakeMouseMoveEventSoon() |
| 2905 { | 2905 { |
| 2906 if (m_mousePressed) | 2906 if (m_mousePressed) |
| 2907 return; | 2907 return; |
| 2908 | 2908 |
| 2909 if (m_mousePositionIsUnknown) | 2909 if (m_mousePositionIsUnknown) |
| 2910 return; | 2910 return; |
| 2911 | 2911 |
| 2912 Settings* settings = m_frame->settings(); | 2912 Settings* settings = m_frame->settings(); |
| 2913 if (settings && !settings->deviceSupportsMouse()) | 2913 if (settings && !settings->deviceSupportsMouse()) |
| 2914 return; | 2914 return; |
| 2915 | 2915 |
| 2916 // If the content has ever taken longer than fakeMouseMoveShortInterval we | 2916 // If the content has ever taken longer than fakeMouseMoveShortInterval we |
| 2917 // reschedule the timer and use a longer time. This will cause the content | 2917 // reschedule the timer and use a longer time. This will cause the content |
| 2918 // to receive these moves only after the user is done scrolling, reducing | 2918 // to receive these moves only after the user is done scrolling, reducing |
| 2919 // pauses during the scroll. | 2919 // pauses during the scroll. |
| 2920 if (m_maxMouseMovedDuration > fakeMouseMoveShortInterval) { | 2920 if (m_maxMouseMovedDuration > fakeMouseMoveShortInterval) { |
| 2921 if (m_fakeMouseMoveEventTimer.isActive()) | 2921 if (m_fakeMouseMoveEventTimer.isActive()) |
| 2922 m_fakeMouseMoveEventTimer.stop(); | 2922 m_fakeMouseMoveEventTimer.stop(); |
| 2923 m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveLongInterval); | 2923 m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveLongInterval, FROM_H
ERE); |
| 2924 } else { | 2924 } else { |
| 2925 if (!m_fakeMouseMoveEventTimer.isActive()) | 2925 if (!m_fakeMouseMoveEventTimer.isActive()) |
| 2926 m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveShortInterval); | 2926 m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveShortInterval, F
ROM_HERE); |
| 2927 } | 2927 } |
| 2928 } | 2928 } |
| 2929 | 2929 |
| 2930 void EventHandler::dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad& quad) | 2930 void EventHandler::dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad& quad) |
| 2931 { | 2931 { |
| 2932 FrameView* view = m_frame->view(); | 2932 FrameView* view = m_frame->view(); |
| 2933 if (!view) | 2933 if (!view) |
| 2934 return; | 2934 return; |
| 2935 | 2935 |
| 2936 if (!quad.containsPoint(view->windowToContents(m_lastKnownMousePosition))) | 2936 if (!quad.containsPoint(view->windowToContents(m_lastKnownMousePosition))) |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4025 unsigned EventHandler::accessKeyModifiers() | 4025 unsigned EventHandler::accessKeyModifiers() |
| 4026 { | 4026 { |
| 4027 #if OS(MACOSX) | 4027 #if OS(MACOSX) |
| 4028 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 4028 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 4029 #else | 4029 #else |
| 4030 return PlatformEvent::AltKey; | 4030 return PlatformEvent::AltKey; |
| 4031 #endif | 4031 #endif |
| 4032 } | 4032 } |
| 4033 | 4033 |
| 4034 } // namespace WebCore | 4034 } // namespace WebCore |
| OLD | NEW |