| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "core/page/ChromeClient.h" | 57 #include "core/page/ChromeClient.h" |
| 58 #include "core/page/EditorClient.h" | 58 #include "core/page/EditorClient.h" |
| 59 #include "core/page/EventWithHitTestResults.h" | 59 #include "core/page/EventWithHitTestResults.h" |
| 60 #include "core/page/FocusController.h" | 60 #include "core/page/FocusController.h" |
| 61 #include "core/page/Page.h" | 61 #include "core/page/Page.h" |
| 62 #include "core/page/TouchAdjustment.h" | 62 #include "core/page/TouchAdjustment.h" |
| 63 #include "core/rendering/HitTestRequest.h" | 63 #include "core/rendering/HitTestRequest.h" |
| 64 #include "core/rendering/HitTestResult.h" | 64 #include "core/rendering/HitTestResult.h" |
| 65 #include "core/rendering/RenderLayer.h" | 65 #include "core/rendering/RenderLayer.h" |
| 66 #include "core/rendering/RenderView.h" | 66 #include "core/rendering/RenderView.h" |
| 67 #include "core/rendering/RenderWidget.h" | |
| 68 #include "core/rendering/style/RenderStyle.h" | 67 #include "core/rendering/style/RenderStyle.h" |
| 69 #include "platform/PlatformGestureEvent.h" | 68 #include "platform/PlatformGestureEvent.h" |
| 70 #include "platform/PlatformKeyboardEvent.h" | 69 #include "platform/PlatformKeyboardEvent.h" |
| 71 #include "platform/PlatformTouchEvent.h" | 70 #include "platform/PlatformTouchEvent.h" |
| 72 #include "platform/PlatformWheelEvent.h" | 71 #include "platform/PlatformWheelEvent.h" |
| 73 #include "platform/RuntimeEnabledFeatures.h" | 72 #include "platform/RuntimeEnabledFeatures.h" |
| 74 #include "platform/TraceEvent.h" | 73 #include "platform/TraceEvent.h" |
| 75 #include "platform/WindowsKeyboardCodes.h" | 74 #include "platform/WindowsKeyboardCodes.h" |
| 76 #include "platform/geometry/FloatPoint.h" | 75 #include "platform/geometry/FloatPoint.h" |
| 77 #include "platform/graphics/Image.h" | 76 #include "platform/graphics/Image.h" |
| (...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1522 } else { | 1521 } else { |
| 1523 if (m_latchedWheelEventNode) | 1522 if (m_latchedWheelEventNode) |
| 1524 m_latchedWheelEventNode = nullptr; | 1523 m_latchedWheelEventNode = nullptr; |
| 1525 if (m_previousWheelScrolledNode) | 1524 if (m_previousWheelScrolledNode) |
| 1526 m_previousWheelScrolledNode = nullptr; | 1525 m_previousWheelScrolledNode = nullptr; |
| 1527 | 1526 |
| 1528 isOverWidget = result.isOverWidget(); | 1527 isOverWidget = result.isOverWidget(); |
| 1529 } | 1528 } |
| 1530 | 1529 |
| 1531 if (node) { | 1530 if (node) { |
| 1532 // Figure out which view to send the event to. | |
| 1533 RenderObject* target = node->renderer(); | |
| 1534 | |
| 1535 if (isOverWidget && target && target->isWidget()) { | |
| 1536 Widget* widget = toRenderWidget(target)->widget(); | |
| 1537 if (widget && passWheelEventToWidget(event, widget)) | |
| 1538 RETURN_WHEEL_EVENT_HANDLED(); | |
| 1539 } | |
| 1540 | |
| 1541 if (node && !node->dispatchWheelEvent(event)) | 1531 if (node && !node->dispatchWheelEvent(event)) |
| 1542 RETURN_WHEEL_EVENT_HANDLED(); | 1532 RETURN_WHEEL_EVENT_HANDLED(); |
| 1543 } | 1533 } |
| 1544 | 1534 |
| 1545 // We do another check on the frame view because the event handler can run J
S which results in the frame getting destroyed. | 1535 // We do another check on the frame view because the event handler can run J
S which results in the frame getting destroyed. |
| 1546 view = m_frame->view(); | 1536 view = m_frame->view(); |
| 1547 if (!view || !view->wheelEvent(event)) | 1537 if (!view || !view->wheelEvent(event)) |
| 1548 return false; | 1538 return false; |
| 1549 | 1539 |
| 1550 RETURN_WHEEL_EVENT_HANDLED(); | 1540 RETURN_WHEEL_EVENT_HANDLED(); |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1859 } | 1849 } |
| 1860 } | 1850 } |
| 1861 | 1851 |
| 1862 return false; | 1852 return false; |
| 1863 } | 1853 } |
| 1864 | 1854 |
| 1865 bool EventHandler::passScrollGestureEventToWidget(const PlatformGestureEvent& ge
stureEvent, RenderObject* renderer) | 1855 bool EventHandler::passScrollGestureEventToWidget(const PlatformGestureEvent& ge
stureEvent, RenderObject* renderer) |
| 1866 { | 1856 { |
| 1867 ASSERT(gestureEvent.isScrollEvent()); | 1857 ASSERT(gestureEvent.isScrollEvent()); |
| 1868 | 1858 |
| 1869 if (!m_lastGestureScrollOverWidget) | 1859 // FIXME(sky): Remove this. |
| 1870 return false; | 1860 return false; |
| 1871 | |
| 1872 if (!renderer || !renderer->isWidget()) | |
| 1873 return false; | |
| 1874 | |
| 1875 Widget* widget = toRenderWidget(renderer)->widget(); | |
| 1876 | |
| 1877 if (!widget || !widget->isFrameView()) | |
| 1878 return false; | |
| 1879 | |
| 1880 return toFrameView(widget)->frame().eventHandler().handleGestureScrollEvent(
gestureEvent); | |
| 1881 } | 1861 } |
| 1882 | 1862 |
| 1883 bool EventHandler::handleGestureScrollEnd(const PlatformGestureEvent& gestureEve
nt) { | 1863 bool EventHandler::handleGestureScrollEnd(const PlatformGestureEvent& gestureEve
nt) { |
| 1884 RefPtr<Node> node = m_scrollGestureHandlingNode; | 1864 RefPtr<Node> node = m_scrollGestureHandlingNode; |
| 1885 clearGestureScrollNodes(); | 1865 clearGestureScrollNodes(); |
| 1886 | 1866 |
| 1887 if (node) | 1867 if (node) |
| 1888 passScrollGestureEventToWidget(gestureEvent, node->renderer()); | 1868 passScrollGestureEventToWidget(gestureEvent, node->renderer()); |
| 1889 | 1869 |
| 1890 return false; | 1870 return false; |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2852 unsigned EventHandler::accessKeyModifiers() | 2832 unsigned EventHandler::accessKeyModifiers() |
| 2853 { | 2833 { |
| 2854 #if OS(MACOSX) | 2834 #if OS(MACOSX) |
| 2855 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 2835 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 2856 #else | 2836 #else |
| 2857 return PlatformEvent::AltKey; | 2837 return PlatformEvent::AltKey; |
| 2858 #endif | 2838 #endif |
| 2859 } | 2839 } |
| 2860 | 2840 |
| 2861 } // namespace blink | 2841 } // namespace blink |
| OLD | NEW |