| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 #include "core/inspector/InspectorController.h" | 62 #include "core/inspector/InspectorController.h" |
| 63 #include "core/loader/FrameLoader.h" | 63 #include "core/loader/FrameLoader.h" |
| 64 #include "core/loader/FrameLoaderClient.h" | 64 #include "core/loader/FrameLoaderClient.h" |
| 65 #include "core/page/AutoscrollController.h" | 65 #include "core/page/AutoscrollController.h" |
| 66 #include "core/page/BackForwardClient.h" | 66 #include "core/page/BackForwardClient.h" |
| 67 #include "core/page/Chrome.h" | 67 #include "core/page/Chrome.h" |
| 68 #include "core/page/ChromeClient.h" | 68 #include "core/page/ChromeClient.h" |
| 69 #include "core/page/DragController.h" | 69 #include "core/page/DragController.h" |
| 70 #include "core/page/DragState.h" | 70 #include "core/page/DragState.h" |
| 71 #include "core/page/EditorClient.h" | 71 #include "core/page/EditorClient.h" |
| 72 #include "core/page/EventWithHitTestResults.h" | |
| 73 #include "core/page/FocusController.h" | 72 #include "core/page/FocusController.h" |
| 74 #include "core/page/FrameTree.h" | 73 #include "core/page/FrameTree.h" |
| 75 #include "core/page/Page.h" | 74 #include "core/page/Page.h" |
| 76 #include "core/page/SpatialNavigation.h" | 75 #include "core/page/SpatialNavigation.h" |
| 77 #include "core/page/TouchAdjustment.h" | 76 #include "core/page/TouchAdjustment.h" |
| 78 #include "core/rendering/HitTestRequest.h" | 77 #include "core/rendering/HitTestRequest.h" |
| 79 #include "core/rendering/HitTestResult.h" | 78 #include "core/rendering/HitTestResult.h" |
| 80 #include "core/rendering/RenderFlowThread.h" | 79 #include "core/rendering/RenderFlowThread.h" |
| 81 #include "core/rendering/RenderLayer.h" | 80 #include "core/rendering/RenderLayer.h" |
| 82 #include "core/rendering/RenderTextControlSingleLine.h" | 81 #include "core/rendering/RenderTextControlSingleLine.h" |
| (...skipping 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2054 return false; | 2053 return false; |
| 2055 for (FrameView::ScrollableAreaSet::const_iterator it = areas->begin(); it !=
areas->end(); ++it) { | 2054 for (FrameView::ScrollableAreaSet::const_iterator it = areas->begin(); it !=
areas->end(); ++it) { |
| 2056 ScrollableArea* sa = *it; | 2055 ScrollableArea* sa = *it; |
| 2057 ScrollAnimator* animator = sa->existingScrollAnimator(); | 2056 ScrollAnimator* animator = sa->existingScrollAnimator(); |
| 2058 if (animator) | 2057 if (animator) |
| 2059 animator->cancelAnimations(); | 2058 animator->cancelAnimations(); |
| 2060 } | 2059 } |
| 2061 return false; | 2060 return false; |
| 2062 } | 2061 } |
| 2063 | 2062 |
| 2064 bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent) | 2063 bool EventHandler::handleGestureEvent(const GestureEventWithHitTestResults& targ
etedEvent) |
| 2065 { | 2064 { |
| 2066 TRACE_EVENT0("input", "EventHandler::handleGestureEvent"); | 2065 TRACE_EVENT0("input", "EventHandler::handleGestureEvent"); |
| 2067 | 2066 |
| 2068 // Propagation to inner frames is handled below this function. | 2067 // Propagation to inner frames is handled below this function. |
| 2069 ASSERT(m_frame == m_frame->localFrameRoot()); | 2068 ASSERT(m_frame == m_frame->localFrameRoot()); |
| 2070 | 2069 |
| 2071 // Scrolling-related gesture events invoke EventHandler recursively for each
frame down | 2070 // Scrolling-related gesture events invoke EventHandler recursively for each
frame down |
| 2072 // the chain, doing a single-frame hit-test per frame. This matches handleWh
eelEvent. | 2071 // the chain, doing a single-frame hit-test per frame. This matches handleWh
eelEvent. |
| 2073 // Perhaps we could simplify things by rewriting scroll handling to work inn
er frame | 2072 // Perhaps we could simplify things by rewriting scroll handling to work inn
er frame |
| 2074 // out, and then unify with other gesture events. | 2073 // out, and then unify with other gesture events. |
| 2075 if (gestureEvent.isScrollEvent()) | 2074 if (targetedEvent.event().isScrollEvent()) |
| 2076 return handleGestureScrollEvent(gestureEvent); | 2075 return handleGestureScrollEvent(targetedEvent.event()); |
| 2077 | 2076 |
| 2078 // Non-scrolling related gesture events instead do a single cross-frame hit-
test and | 2077 // Non-scrolling related gesture events instead reuse the cross-frame hit-te
st from |
| 2079 // jump directly to the inner most frame. This matches handleMousePressEvent
etc. | 2078 // targetedEvent and jump directly to the inner most frame. This matches |
| 2080 | 2079 // handleMousePressEvent etc. |
| 2081 // Hit test across all frames and do touch adjustment as necessary for the e
vent type. | |
| 2082 GestureEventWithHitTestResults targetedEvent = targetGestureEvent(gestureEve
nt); | |
| 2083 | 2080 |
| 2084 // Route to the correct frame. | 2081 // Route to the correct frame. |
| 2085 if (LocalFrame* innerFrame = targetedEvent.hitTestResult().innerNodeFrame()) | 2082 if (LocalFrame* innerFrame = targetedEvent.hitTestResult().innerNodeFrame()) |
| 2086 return innerFrame->eventHandler().handleGestureEventInFrame(targetedEven
t); | 2083 return innerFrame->eventHandler().handleGestureEventInFrame(targetedEven
t); |
| 2087 | 2084 |
| 2088 // No hit test result, handle in root instance. Perhaps we should just retur
n false instead? | 2085 // No hit test result, handle in root instance. Perhaps we should just retur
n false instead? |
| 2089 return handleGestureEventInFrame(targetedEvent); | 2086 return handleGestureEventInFrame(targetedEvent); |
| 2090 } | 2087 } |
| 2091 | 2088 |
| 2092 bool EventHandler::handleGestureEventInFrame(const GestureEventWithHitTestResult
s& targetedEvent) | 2089 bool EventHandler::handleGestureEventInFrame(const GestureEventWithHitTestResult
s& targetedEvent) |
| (...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3850 unsigned EventHandler::accessKeyModifiers() | 3847 unsigned EventHandler::accessKeyModifiers() |
| 3851 { | 3848 { |
| 3852 #if OS(MACOSX) | 3849 #if OS(MACOSX) |
| 3853 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3850 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 3854 #else | 3851 #else |
| 3855 return PlatformEvent::AltKey; | 3852 return PlatformEvent::AltKey; |
| 3856 #endif | 3853 #endif |
| 3857 } | 3854 } |
| 3858 | 3855 |
| 3859 } // namespace blink | 3856 } // namespace blink |
| OLD | NEW |