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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 visitor->trace(m_frame); | 279 visitor->trace(m_frame); |
280 visitor->trace(m_mousePressNode); | 280 visitor->trace(m_mousePressNode); |
281 visitor->trace(m_resizeScrollableArea); | 281 visitor->trace(m_resizeScrollableArea); |
282 visitor->trace(m_capturingMouseEventsNode); | 282 visitor->trace(m_capturingMouseEventsNode); |
283 visitor->trace(m_nodeUnderMouse); | 283 visitor->trace(m_nodeUnderMouse); |
284 visitor->trace(m_lastMouseMoveEventSubframe); | 284 visitor->trace(m_lastMouseMoveEventSubframe); |
285 visitor->trace(m_lastScrollbarUnderMouse); | 285 visitor->trace(m_lastScrollbarUnderMouse); |
286 visitor->trace(m_clickNode); | 286 visitor->trace(m_clickNode); |
287 visitor->trace(m_dragTarget); | 287 visitor->trace(m_dragTarget); |
288 visitor->trace(m_frameSetBeingResized); | 288 visitor->trace(m_frameSetBeingResized); |
289 visitor->trace(m_previousWheelScrolledNode); | |
290 visitor->trace(m_scrollbarHandlingScrollGesture); | 289 visitor->trace(m_scrollbarHandlingScrollGesture); |
291 visitor->trace(m_targetForTouchID); | 290 visitor->trace(m_targetForTouchID); |
292 visitor->trace(m_touchSequenceDocument); | 291 visitor->trace(m_touchSequenceDocument); |
293 visitor->trace(m_scrollGestureHandlingNode); | 292 visitor->trace(m_scrollGestureHandlingNode); |
294 visitor->trace(m_previousGestureScrolledNode); | 293 visitor->trace(m_previousGestureScrolledNode); |
295 visitor->trace(m_lastDeferredTapElement); | 294 visitor->trace(m_lastDeferredTapElement); |
296 visitor->trace(m_selectionController); | 295 visitor->trace(m_selectionController); |
297 visitor->trace(m_pointerEventManager); | 296 visitor->trace(m_pointerEventManager); |
298 #endif | 297 #endif |
299 } | 298 } |
(...skipping 20 matching lines...) Expand all Loading... |
320 m_dragTarget = nullptr; | 319 m_dragTarget = nullptr; |
321 m_shouldOnlyFireDragOverEvent = false; | 320 m_shouldOnlyFireDragOverEvent = false; |
322 m_mousePositionIsUnknown = true; | 321 m_mousePositionIsUnknown = true; |
323 m_lastKnownMousePosition = IntPoint(); | 322 m_lastKnownMousePosition = IntPoint(); |
324 m_lastKnownMouseGlobalPosition = IntPoint(); | 323 m_lastKnownMouseGlobalPosition = IntPoint(); |
325 m_lastMouseDownUserGestureToken.clear(); | 324 m_lastMouseDownUserGestureToken.clear(); |
326 m_mousePressNode = nullptr; | 325 m_mousePressNode = nullptr; |
327 m_mousePressed = false; | 326 m_mousePressed = false; |
328 m_capturesDragging = false; | 327 m_capturesDragging = false; |
329 m_capturingMouseEventsNode = nullptr; | 328 m_capturingMouseEventsNode = nullptr; |
330 m_previousWheelScrolledNode = nullptr; | |
331 m_targetForTouchID.clear(); | 329 m_targetForTouchID.clear(); |
332 m_touchSequenceDocument.clear(); | 330 m_touchSequenceDocument.clear(); |
333 m_touchSequenceUserGestureToken.clear(); | 331 m_touchSequenceUserGestureToken.clear(); |
334 clearGestureScrollState(); | 332 clearGestureScrollState(); |
335 m_lastGestureScrollOverWidget = false; | 333 m_lastGestureScrollOverWidget = false; |
336 m_scrollbarHandlingScrollGesture = nullptr; | 334 m_scrollbarHandlingScrollGesture = nullptr; |
337 m_touchPressed = false; | 335 m_touchPressed = false; |
338 m_pointerEventManager.clear(); | 336 m_pointerEventManager.clear(); |
339 m_inPointerCanceledState = false; | 337 m_inPointerCanceledState = false; |
340 m_mouseDownMayStartDrag = false; | 338 m_mouseDownMayStartDrag = false; |
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 | 1783 |
1786 HitTestRequest request(HitTestRequest::ReadOnly); | 1784 HitTestRequest request(HitTestRequest::ReadOnly); |
1787 HitTestResult result(request, vPoint); | 1785 HitTestResult result(request, vPoint); |
1788 doc->layoutView()->hitTest(result); | 1786 doc->layoutView()->hitTest(result); |
1789 | 1787 |
1790 Node* node = result.innerNode(); | 1788 Node* node = result.innerNode(); |
1791 // Wheel events should not dispatch to text nodes. | 1789 // Wheel events should not dispatch to text nodes. |
1792 if (node && node->isTextNode()) | 1790 if (node && node->isTextNode()) |
1793 node = FlatTreeTraversal::parent(*node); | 1791 node = FlatTreeTraversal::parent(*node); |
1794 | 1792 |
1795 if (m_previousWheelScrolledNode) | |
1796 m_previousWheelScrolledNode = nullptr; | |
1797 | |
1798 bool isOverWidget = result.isOverWidget(); | 1793 bool isOverWidget = result.isOverWidget(); |
1799 | 1794 |
1800 if (node) { | 1795 if (node) { |
1801 // Figure out which view to send the event to. | 1796 // Figure out which view to send the event to. |
1802 LayoutObject* target = node->layoutObject(); | 1797 LayoutObject* target = node->layoutObject(); |
1803 | 1798 |
1804 if (isOverWidget && target && target->isLayoutPart()) { | 1799 if (isOverWidget && target && target->isLayoutPart()) { |
1805 if (Widget* widget = toLayoutPart(target)->widget()) { | 1800 if (Widget* widget = toLayoutPart(target)->widget()) { |
1806 WebInputEventResult result = passWheelEventToWidget(event, *widg
et); | 1801 WebInputEventResult result = passWheelEventToWidget(event, *widg
et); |
1807 if (result != WebInputEventResult::NotHandled) { | 1802 if (result != WebInputEventResult::NotHandled) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1842 | 1837 |
1843 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv
ent) | 1838 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv
ent) |
1844 { | 1839 { |
1845 if (!startNode || !wheelEvent) | 1840 if (!startNode || !wheelEvent) |
1846 return; | 1841 return; |
1847 | 1842 |
1848 // When the wheelEvent do not scroll, we trigger zoom in/out instead. | 1843 // When the wheelEvent do not scroll, we trigger zoom in/out instead. |
1849 if (!wheelEvent->canScroll()) | 1844 if (!wheelEvent->canScroll()) |
1850 return; | 1845 return; |
1851 | 1846 |
1852 Node* stopNode = m_previousWheelScrolledNode.get(); | |
1853 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve
nt); | 1847 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve
nt); |
| 1848 Node* node = nullptr; |
1854 | 1849 |
1855 // Break up into two scrolls if we need to. Diagonal movement on | 1850 // Break up into two scrolls if we need to. Diagonal movement on |
1856 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b
oth deltaX and deltaY can be set). | 1851 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b
oth deltaX and deltaY can be set). |
1857 | 1852 |
1858 // FIXME: enable scroll customization in this case. See crbug.com/410974. | 1853 // FIXME: enable scroll customization in this case. See crbug.com/410974. |
1859 if (wheelEvent->getRailsMode() != Event::RailsModeVertical | 1854 if (wheelEvent->getRailsMode() != Event::RailsModeVertical |
1860 && scroll(ScrollRightIgnoringWritingMode, granularity, startNode, &stopN
ode, wheelEvent->deltaX()).didScroll) | 1855 && scroll(ScrollRightIgnoringWritingMode, granularity, startNode, &node,
wheelEvent->deltaX()).didScroll) |
1861 wheelEvent->setDefaultHandled(); | 1856 wheelEvent->setDefaultHandled(); |
1862 | 1857 |
1863 if (wheelEvent->getRailsMode() != Event::RailsModeHorizontal | 1858 if (wheelEvent->getRailsMode() != Event::RailsModeHorizontal |
1864 && scroll(ScrollDownIgnoringWritingMode, granularity, startNode, &stopNo
de, wheelEvent->deltaY()).didScroll) | 1859 && scroll(ScrollDownIgnoringWritingMode, granularity, startNode, &node,
wheelEvent->deltaY()).didScroll) |
1865 wheelEvent->setDefaultHandled(); | 1860 wheelEvent->setDefaultHandled(); |
1866 | |
1867 m_previousWheelScrolledNode = stopNode; | |
1868 } | 1861 } |
1869 | 1862 |
1870 WebInputEventResult EventHandler::handleGestureShowPress() | 1863 WebInputEventResult EventHandler::handleGestureShowPress() |
1871 { | 1864 { |
1872 m_lastShowPressTimestamp = WTF::monotonicallyIncreasingTime(); | 1865 m_lastShowPressTimestamp = WTF::monotonicallyIncreasingTime(); |
1873 | 1866 |
1874 FrameView* view = m_frame->view(); | 1867 FrameView* view = m_frame->view(); |
1875 if (!view) | 1868 if (!view) |
1876 return WebInputEventResult::NotHandled; | 1869 return WebInputEventResult::NotHandled; |
1877 if (ScrollAnimatorBase* scrollAnimator = view->existingScrollAnimator()) | 1870 if (ScrollAnimatorBase* scrollAnimator = view->existingScrollAnimator()) |
(...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3982 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() | 3975 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() |
3983 { | 3976 { |
3984 #if OS(MACOSX) | 3977 #if OS(MACOSX) |
3985 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); | 3978 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); |
3986 #else | 3979 #else |
3987 return PlatformEvent::AltKey; | 3980 return PlatformEvent::AltKey; |
3988 #endif | 3981 #endif |
3989 } | 3982 } |
3990 | 3983 |
3991 } // namespace blink | 3984 } // namespace blink |
OLD | NEW |