| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 #include "core/page/FocusController.h" | 81 #include "core/page/FocusController.h" |
| 82 #include "core/page/FrameTree.h" | 82 #include "core/page/FrameTree.h" |
| 83 #include "core/page/Page.h" | 83 #include "core/page/Page.h" |
| 84 #include "core/page/TouchAdjustment.h" | 84 #include "core/page/TouchAdjustment.h" |
| 85 #include "core/page/scrolling/ScrollState.h" | 85 #include "core/page/scrolling/ScrollState.h" |
| 86 #include "core/paint/PaintLayer.h" | 86 #include "core/paint/PaintLayer.h" |
| 87 #include "core/style/ComputedStyle.h" | 87 #include "core/style/ComputedStyle.h" |
| 88 #include "core/style/CursorData.h" | 88 #include "core/style/CursorData.h" |
| 89 #include "core/svg/SVGDocumentExtensions.h" | 89 #include "core/svg/SVGDocumentExtensions.h" |
| 90 #include "platform/PlatformTouchEvent.h" | 90 #include "platform/PlatformTouchEvent.h" |
| 91 #include "platform/PlatformWheelEvent.h" | |
| 92 #include "platform/RuntimeEnabledFeatures.h" | 91 #include "platform/RuntimeEnabledFeatures.h" |
| 93 #include "platform/WindowsKeyboardCodes.h" | 92 #include "platform/WindowsKeyboardCodes.h" |
| 94 #include "platform/geometry/FloatPoint.h" | 93 #include "platform/geometry/FloatPoint.h" |
| 95 #include "platform/graphics/Image.h" | 94 #include "platform/graphics/Image.h" |
| 96 #include "platform/heap/Handle.h" | 95 #include "platform/heap/Handle.h" |
| 97 #include "platform/scroll/ScrollAnimatorBase.h" | 96 #include "platform/scroll/ScrollAnimatorBase.h" |
| 98 #include "platform/scroll/Scrollbar.h" | 97 #include "platform/scroll/Scrollbar.h" |
| 99 #include "platform/tracing/TraceEvent.h" | 98 #include "platform/tracing/TraceEvent.h" |
| 100 #include "public/platform/WebInputEvent.h" | 99 #include "public/platform/WebInputEvent.h" |
| 100 #include "public/platform/WebMouseWheelEvent.h" |
| 101 #include "wtf/Assertions.h" | 101 #include "wtf/Assertions.h" |
| 102 #include "wtf/CurrentTime.h" | 102 #include "wtf/CurrentTime.h" |
| 103 #include "wtf/PtrUtil.h" | 103 #include "wtf/PtrUtil.h" |
| 104 #include "wtf/StdLibExtras.h" | 104 #include "wtf/StdLibExtras.h" |
| 105 #include <memory> | 105 #include <memory> |
| 106 | 106 |
| 107 namespace blink { | 107 namespace blink { |
| 108 | 108 |
| 109 namespace { | 109 namespace { |
| 110 | 110 |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 mouseEventType == EventTypeNames::mousemove || | 1262 mouseEventType == EventTypeNames::mousemove || |
| 1263 mouseEventType == EventTypeNames::mouseup); | 1263 mouseEventType == EventTypeNames::mouseup); |
| 1264 | 1264 |
| 1265 const auto& eventResult = m_pointerEventManager->sendMousePointerEvent( | 1265 const auto& eventResult = m_pointerEventManager->sendMousePointerEvent( |
| 1266 updateMouseEventTargetNode(targetNode), mouseEventType, mouseEvent, | 1266 updateMouseEventTargetNode(targetNode), mouseEventType, mouseEvent, |
| 1267 coalescedEvents); | 1267 coalescedEvents); |
| 1268 return eventResult; | 1268 return eventResult; |
| 1269 } | 1269 } |
| 1270 | 1270 |
| 1271 WebInputEventResult EventHandler::handleWheelEvent( | 1271 WebInputEventResult EventHandler::handleWheelEvent( |
| 1272 const PlatformWheelEvent& event) { | 1272 const WebMouseWheelEvent& event) { |
| 1273 #if OS(MACOSX) | 1273 #if OS(MACOSX) |
| 1274 // Filter Mac OS specific phases, usually with a zero-delta. | 1274 // Filter Mac OS specific phases, usually with a zero-delta. |
| 1275 // https://crbug.com/553732 | 1275 // https://crbug.com/553732 |
| 1276 // TODO(chongz): EventSender sends events with |PlatformWheelEventPhaseNone|, | 1276 // TODO(chongz): EventSender sends events with |
| 1277 // |WebMouseWheelEvent::PhaseNone|, |
| 1277 // but it shouldn't. | 1278 // but it shouldn't. |
| 1278 const int kPlatformWheelEventPhaseNoEventMask = | 1279 const int kWheelEventPhaseNoEventMask = WebMouseWheelEvent::PhaseEnded | |
| 1279 PlatformWheelEventPhaseEnded | PlatformWheelEventPhaseCancelled | | 1280 WebMouseWheelEvent::PhaseCancelled | |
| 1280 PlatformWheelEventPhaseMayBegin; | 1281 WebMouseWheelEvent::PhaseMayBegin; |
| 1281 if ((event.phase() & kPlatformWheelEventPhaseNoEventMask) || | 1282 if ((event.phase & kWheelEventPhaseNoEventMask) || |
| 1282 (event.momentumPhase() & kPlatformWheelEventPhaseNoEventMask)) | 1283 (event.momentumPhase & kWheelEventPhaseNoEventMask)) |
| 1283 return WebInputEventResult::NotHandled; | 1284 return WebInputEventResult::NotHandled; |
| 1284 #endif | 1285 #endif |
| 1285 Document* doc = m_frame->document(); | 1286 Document* doc = m_frame->document(); |
| 1286 | 1287 |
| 1287 if (doc->layoutViewItem().isNull()) | 1288 if (doc->layoutViewItem().isNull()) |
| 1288 return WebInputEventResult::NotHandled; | 1289 return WebInputEventResult::NotHandled; |
| 1289 | 1290 |
| 1290 FrameView* view = m_frame->view(); | 1291 FrameView* view = m_frame->view(); |
| 1291 if (!view) | 1292 if (!view) |
| 1292 return WebInputEventResult::NotHandled; | 1293 return WebInputEventResult::NotHandled; |
| 1293 | 1294 |
| 1294 LayoutPoint vPoint = view->rootFrameToContents(event.position()); | 1295 LayoutPoint vPoint = |
| 1296 view->rootFrameToContents(flooredIntPoint(event.positionInRootFrame())); |
| 1295 | 1297 |
| 1296 HitTestRequest request(HitTestRequest::ReadOnly); | 1298 HitTestRequest request(HitTestRequest::ReadOnly); |
| 1297 HitTestResult result(request, vPoint); | 1299 HitTestResult result(request, vPoint); |
| 1298 doc->layoutViewItem().hitTest(result); | 1300 doc->layoutViewItem().hitTest(result); |
| 1299 | 1301 |
| 1300 Node* node = result.innerNode(); | 1302 Node* node = result.innerNode(); |
| 1301 // Wheel events should not dispatch to text nodes. | 1303 // Wheel events should not dispatch to text nodes. |
| 1302 if (node && node->isTextNode()) | 1304 if (node && node->isTextNode()) |
| 1303 node = FlatTreeTraversal::parent(*node); | 1305 node = FlatTreeTraversal::parent(*node); |
| 1304 | 1306 |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2122 } | 2124 } |
| 2123 | 2125 |
| 2124 FrameHost* EventHandler::frameHost() const { | 2126 FrameHost* EventHandler::frameHost() const { |
| 2125 if (!m_frame->page()) | 2127 if (!m_frame->page()) |
| 2126 return nullptr; | 2128 return nullptr; |
| 2127 | 2129 |
| 2128 return &m_frame->page()->frameHost(); | 2130 return &m_frame->page()->frameHost(); |
| 2129 } | 2131 } |
| 2130 | 2132 |
| 2131 } // namespace blink | 2133 } // namespace blink |
| OLD | NEW |