Chromium Code Reviews| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 , m_eventHandlerWillResetCapturingMouseEventsNode(0) | 208 , m_eventHandlerWillResetCapturingMouseEventsNode(0) |
| 209 , m_clickCount(0) | 209 , m_clickCount(0) |
| 210 , m_shouldOnlyFireDragOverEvent(false) | 210 , m_shouldOnlyFireDragOverEvent(false) |
| 211 , m_mousePositionIsUnknown(true) | 211 , m_mousePositionIsUnknown(true) |
| 212 , m_mouseDownTimestamp(0) | 212 , m_mouseDownTimestamp(0) |
| 213 , m_pointerEventManager(frame) | 213 , m_pointerEventManager(frame) |
| 214 , m_scrollManager(frame) | 214 , m_scrollManager(frame) |
| 215 , m_longTapShouldInvokeContextMenu(false) | 215 , m_longTapShouldInvokeContextMenu(false) |
| 216 , m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired) | 216 , m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired) |
| 217 , m_lastShowPressTimestamp(0) | 217 , m_lastShowPressTimestamp(0) |
| 218 , m_suppressMouseEventsFromGestures(false) | |
| 218 { | 219 { |
| 219 } | 220 } |
| 220 | 221 |
| 221 EventHandler::~EventHandler() | 222 EventHandler::~EventHandler() |
| 222 { | 223 { |
| 223 ASSERT(!m_fakeMouseMoveEventTimer.isActive()); | 224 ASSERT(!m_fakeMouseMoveEventTimer.isActive()); |
| 224 } | 225 } |
| 225 | 226 |
| 226 DEFINE_TRACE(EventHandler) | 227 DEFINE_TRACE(EventHandler) |
| 227 { | 228 { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 m_lastShowPressTimestamp = 0; | 275 m_lastShowPressTimestamp = 0; |
| 275 m_lastDeferredTapElement = nullptr; | 276 m_lastDeferredTapElement = nullptr; |
| 276 m_eventHandlerWillResetCapturingMouseEventsNode = false; | 277 m_eventHandlerWillResetCapturingMouseEventsNode = false; |
| 277 m_mouseDownMayStartAutoscroll = false; | 278 m_mouseDownMayStartAutoscroll = false; |
| 278 m_svgPan = false; | 279 m_svgPan = false; |
| 279 m_mouseDownPos = IntPoint(); | 280 m_mouseDownPos = IntPoint(); |
| 280 m_mouseDownTimestamp = 0; | 281 m_mouseDownTimestamp = 0; |
| 281 m_longTapShouldInvokeContextMenu = false; | 282 m_longTapShouldInvokeContextMenu = false; |
| 282 m_dragStartPos = LayoutPoint(); | 283 m_dragStartPos = LayoutPoint(); |
| 283 m_mouseDown = PlatformMouseEvent(); | 284 m_mouseDown = PlatformMouseEvent(); |
| 285 m_suppressMouseEventsFromGestures = false; | |
| 284 } | 286 } |
| 285 | 287 |
| 286 WebInputEventResult EventHandler::mergeEventResult( | 288 WebInputEventResult EventHandler::mergeEventResult( |
| 287 WebInputEventResult resultA, WebInputEventResult resultB) | 289 WebInputEventResult resultA, WebInputEventResult resultB) |
| 288 { | 290 { |
| 289 // The ordering of the enumeration is specific. There are times that | 291 // The ordering of the enumeration is specific. There are times that |
| 290 // multiple events fire and we need to combine them into a single | 292 // multiple events fire and we need to combine them into a single |
| 291 // result code. The enumeration is based on the level of consumption that | 293 // result code. The enumeration is based on the level of consumption that |
| 292 // is most significant. The enumeration is ordered with smaller specified | 294 // is most significant. The enumeration is ordered with smaller specified |
| 293 // numbers first. Examples of merged results are: | 295 // numbers first. Examples of merged results are: |
| (...skipping 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1802 if (gestureDomEvent) { | 1804 if (gestureDomEvent) { |
| 1803 DispatchEventResult gestureDomEventResult = eventTarget->dispatchEve nt(gestureDomEvent); | 1805 DispatchEventResult gestureDomEventResult = eventTarget->dispatchEve nt(gestureDomEvent); |
| 1804 if (gestureDomEventResult != DispatchEventResult::NotCanceled) { | 1806 if (gestureDomEventResult != DispatchEventResult::NotCanceled) { |
| 1805 ASSERT(gestureDomEventResult != DispatchEventResult::CanceledByE ventHandler); | 1807 ASSERT(gestureDomEventResult != DispatchEventResult::CanceledByE ventHandler); |
| 1806 return toWebInputEventResult(gestureDomEventResult); | 1808 return toWebInputEventResult(gestureDomEventResult); |
| 1807 } | 1809 } |
| 1808 } | 1810 } |
| 1809 } | 1811 } |
| 1810 | 1812 |
| 1811 switch (gestureEvent.type()) { | 1813 switch (gestureEvent.type()) { |
| 1814 case PlatformEvent::GestureTapDown: | |
| 1815 return handleGestureTapDown(targetedEvent); | |
| 1812 case PlatformEvent::GestureTap: | 1816 case PlatformEvent::GestureTap: |
| 1813 return handleGestureTap(targetedEvent); | 1817 return handleGestureTap(targetedEvent); |
| 1814 case PlatformEvent::GestureShowPress: | 1818 case PlatformEvent::GestureShowPress: |
| 1815 return handleGestureShowPress(); | 1819 return handleGestureShowPress(); |
| 1816 case PlatformEvent::GestureLongPress: | 1820 case PlatformEvent::GestureLongPress: |
| 1817 return handleGestureLongPress(targetedEvent); | 1821 return handleGestureLongPress(targetedEvent); |
| 1818 case PlatformEvent::GestureLongTap: | 1822 case PlatformEvent::GestureLongTap: |
| 1819 return handleGestureLongTap(targetedEvent); | 1823 return handleGestureLongTap(targetedEvent); |
| 1820 case PlatformEvent::GestureTwoFingerTap: | 1824 case PlatformEvent::GestureTwoFingerTap: |
| 1821 return sendContextMenuEventForGesture(targetedEvent); | 1825 return sendContextMenuEventForGesture(targetedEvent); |
| 1822 case PlatformEvent::GestureTapDown: | |
| 1823 case PlatformEvent::GesturePinchBegin: | 1826 case PlatformEvent::GesturePinchBegin: |
| 1824 case PlatformEvent::GesturePinchEnd: | 1827 case PlatformEvent::GesturePinchEnd: |
| 1825 case PlatformEvent::GesturePinchUpdate: | 1828 case PlatformEvent::GesturePinchUpdate: |
| 1826 case PlatformEvent::GestureTapDownCancel: | 1829 case PlatformEvent::GestureTapDownCancel: |
| 1827 case PlatformEvent::GestureTapUnconfirmed: | 1830 case PlatformEvent::GestureTapUnconfirmed: |
| 1828 break; | 1831 break; |
| 1829 default: | 1832 default: |
| 1830 ASSERT_NOT_REACHED(); | 1833 ASSERT_NOT_REACHED(); |
| 1831 } | 1834 } |
| 1832 | 1835 |
| 1833 return WebInputEventResult::NotHandled; | 1836 return WebInputEventResult::NotHandled; |
| 1834 } | 1837 } |
| 1835 | 1838 |
| 1836 WebInputEventResult EventHandler::handleGestureScrollEvent(const PlatformGesture Event& gestureEvent) | 1839 WebInputEventResult EventHandler::handleGestureScrollEvent(const PlatformGesture Event& gestureEvent) |
| 1837 { | 1840 { |
| 1838 TRACE_EVENT0("input", "EventHandler::handleGestureScrollEvent"); | 1841 TRACE_EVENT0("input", "EventHandler::handleGestureScrollEvent"); |
| 1839 | 1842 |
| 1840 return m_scrollManager.handleGestureScrollEvent(gestureEvent); | 1843 return m_scrollManager.handleGestureScrollEvent(gestureEvent); |
| 1841 } | 1844 } |
| 1842 | 1845 |
| 1846 WebInputEventResult EventHandler::handleGestureTapDown(const GestureEventWithHit TestResults& targetedEvent) | |
| 1847 { | |
| 1848 m_suppressMouseEventsFromGestures = | |
| 1849 m_pointerEventManager.primaryPointerdownCanceled(targetedEvent.event().u niqueTouchEventId()); | |
| 1850 return WebInputEventResult::NotHandled; | |
| 1851 } | |
| 1852 | |
| 1843 WebInputEventResult EventHandler::handleGestureTap(const GestureEventWithHitTest Results& targetedEvent) | 1853 WebInputEventResult EventHandler::handleGestureTap(const GestureEventWithHitTest Results& targetedEvent) |
| 1844 { | 1854 { |
| 1845 FrameView* frameView(m_frame->view()); | 1855 FrameView* frameView(m_frame->view()); |
| 1846 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); | 1856 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); |
| 1847 HitTestRequest::HitTestRequestType hitType = getHitTypeForGestureType(gestur eEvent.type()); | 1857 HitTestRequest::HitTestRequestType hitType = getHitTypeForGestureType(gestur eEvent.type()); |
| 1848 uint64_t preDispatchDomTreeVersion = m_frame->document()->domTreeVersion(); | 1858 uint64_t preDispatchDomTreeVersion = m_frame->document()->domTreeVersion(); |
| 1849 uint64_t preDispatchStyleVersion = m_frame->document()->styleVersion(); | 1859 uint64_t preDispatchStyleVersion = m_frame->document()->styleVersion(); |
| 1850 | 1860 |
| 1851 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); | 1861 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); |
| 1852 | 1862 |
| 1853 HitTestResult currentHitTest = targetedEvent.hitTestResult(); | 1863 HitTestResult currentHitTest = targetedEvent.hitTestResult(); |
| 1854 | 1864 |
| 1855 // We use the adjusted position so the application isn't surprised to see a event with | 1865 // We use the adjusted position so the application isn't surprised to see a event with |
| 1856 // co-ordinates outside the target's bounds. | 1866 // co-ordinates outside the target's bounds. |
| 1857 IntPoint adjustedPoint = frameView->rootFrameToContents(gestureEvent.positio n()); | 1867 IntPoint adjustedPoint = frameView->rootFrameToContents(gestureEvent.positio n()); |
| 1858 | 1868 |
| 1859 unsigned modifiers = gestureEvent.getModifiers(); | 1869 const unsigned modifiers = gestureEvent.getModifiers(); |
| 1860 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.globa lPosition(), | 1870 |
| 1861 NoButton, PlatformEvent::MouseMoved, /* clickCount */ 0, | 1871 if (!m_suppressMouseEventsFromGestures) { |
| 1862 static_cast<PlatformEvent::Modifiers>(modifiers), | 1872 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.g lobalPosition(), |
| 1863 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerPrope rties::PointerType::Mouse); | 1873 NoButton, PlatformEvent::MouseMoved, /* clickCount */ 0, |
| 1864 dispatchMouseEvent(EventTypeNames::mousemove, currentHitTest.innerNode(), 0, fakeMouseMove); | 1874 static_cast<PlatformEvent::Modifiers>(modifiers), |
| 1875 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerP roperties::PointerType::Mouse); | |
| 1876 dispatchMouseEvent(EventTypeNames::mousemove, currentHitTest.innerNode() , 0, fakeMouseMove); | |
| 1877 } | |
| 1865 | 1878 |
| 1866 // Do a new hit-test in case the mousemove event changed the DOM. | 1879 // Do a new hit-test in case the mousemove event changed the DOM. |
| 1867 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we | 1880 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we |
| 1868 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page | 1881 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page |
| 1869 // could have seen the event anyway). | 1882 // could have seen the event anyway). |
| 1870 // Also note that the position of the frame may have changed, so we need to recompute the content | 1883 // Also note that the position of the frame may have changed, so we need to recompute the content |
| 1871 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d). | 1884 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d). |
| 1872 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 | 1885 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 |
| 1873 if (currentHitTest.innerNode()) { | 1886 if (currentHitTest.innerNode()) { |
| 1874 LocalFrame* mainFrame = m_frame->localFrameRoot(); | 1887 LocalFrame* mainFrame = m_frame->localFrameRoot(); |
| 1875 if (mainFrame && mainFrame->view()) | 1888 if (mainFrame && mainFrame->view()) |
| 1876 mainFrame->view()->updateLifecycleToCompositingCleanPlusScrolling(); | 1889 mainFrame->view()->updateLifecycleToCompositingCleanPlusScrolling(); |
| 1877 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); | 1890 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); |
| 1878 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); | 1891 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); |
| 1879 } | 1892 } |
| 1880 m_clickNode = currentHitTest.innerNode(); | 1893 m_clickNode = currentHitTest.innerNode(); |
| 1881 | 1894 |
| 1882 // Capture data for showUnhandledTapUIIfNeeded. | 1895 // Capture data for showUnhandledTapUIIfNeeded. |
| 1883 Node* tappedNode = m_clickNode; | 1896 Node* tappedNode = m_clickNode; |
| 1884 IntPoint tappedPosition = gestureEvent.position(); | 1897 IntPoint tappedPosition = gestureEvent.position(); |
| 1885 | 1898 |
| 1886 if (m_clickNode && m_clickNode->isTextNode()) | 1899 if (m_clickNode && m_clickNode->isTextNode()) |
| 1887 m_clickNode = FlatTreeTraversal::parent(*m_clickNode); | 1900 m_clickNode = FlatTreeTraversal::parent(*m_clickNode); |
| 1888 | 1901 |
| 1889 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(), | 1902 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(), |
| 1890 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(), | 1903 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(), |
| 1891 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut tonDown), | 1904 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut tonDown), |
| 1892 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerProp erties::PointerType::Mouse); | 1905 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerPrope rties::PointerType::Mouse); |
| 1893 WebInputEventResult mouseDownEventResult = dispatchMouseEvent(EventTypeNames ::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown) ; | 1906 WebInputEventResult mouseDownEventResult = WebInputEventResult::NotHandled; |
|
Rick Byers
2016/06/03 16:20:44
Back to the earlier discussion - as written this m
mustaq
2016/06/03 20:34:45
Looks like we were thinking in opposite directions
| |
| 1907 if (!m_suppressMouseEventsFromGestures) | |
| 1908 mouseDownEventResult = dispatchMouseEvent(EventTypeNames::mousedown, cur rentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown); | |
| 1894 selectionController().initializeSelectionState(); | 1909 selectionController().initializeSelectionState(); |
| 1895 if (mouseDownEventResult == WebInputEventResult::NotHandled) | 1910 if (mouseDownEventResult == WebInputEventResult::NotHandled) |
| 1896 mouseDownEventResult = handleMouseFocus(MouseEventWithHitTestResults(fak eMouseDown, currentHitTest), InputDeviceCapabilities::firesTouchEventsSourceCapa bilities()); | 1911 mouseDownEventResult = handleMouseFocus(MouseEventWithHitTestResults(fak eMouseDown, currentHitTest), InputDeviceCapabilities::firesTouchEventsSourceCapa bilities()); |
| 1897 if (mouseDownEventResult == WebInputEventResult::NotHandled) | 1912 if (mouseDownEventResult == WebInputEventResult::NotHandled) |
| 1898 mouseDownEventResult = handleMousePressEvent(MouseEventWithHitTestResult s(fakeMouseDown, currentHitTest)); | 1913 mouseDownEventResult = handleMousePressEvent(MouseEventWithHitTestResult s(fakeMouseDown, currentHitTest)); |
| 1899 | 1914 |
| 1900 if (currentHitTest.innerNode()) { | 1915 if (currentHitTest.innerNode()) { |
| 1901 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap); | 1916 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap); |
| 1902 HitTestResult result = currentHitTest; | 1917 HitTestResult result = currentHitTest; |
| 1903 result.setToShadowHostIfInUserAgentShadowRoot(); | 1918 result.setToShadowHostIfInUserAgentShadowRoot(); |
| 1904 m_frame->chromeClient().onMouseDown(result.innerNode()); | 1919 m_frame->chromeClient().onMouseDown(result.innerNode()); |
| 1905 } | 1920 } |
| 1906 | 1921 |
| 1907 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 | 1922 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 |
| 1908 if (currentHitTest.innerNode()) { | 1923 if (currentHitTest.innerNode()) { |
| 1909 LocalFrame* mainFrame = m_frame->localFrameRoot(); | 1924 LocalFrame* mainFrame = m_frame->localFrameRoot(); |
| 1910 if (mainFrame && mainFrame->view()) | 1925 if (mainFrame && mainFrame->view()) |
| 1911 mainFrame->view()->updateAllLifecyclePhases(); | 1926 mainFrame->view()->updateAllLifecyclePhases(); |
| 1912 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); | 1927 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); |
| 1913 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); | 1928 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); |
| 1914 } | 1929 } |
| 1930 | |
| 1915 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), | 1931 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), |
| 1916 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), | 1932 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), |
| 1917 static_cast<PlatformEvent::Modifiers>(modifiers), | 1933 static_cast<PlatformEvent::Modifiers>(modifiers), |
| 1918 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerProp erties::PointerType::Mouse); | 1934 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerPrope rties::PointerType::Mouse); |
| 1919 WebInputEventResult mouseUpEventResult = dispatchMouseEvent(EventTypeNames:: mouseup, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp); | 1935 WebInputEventResult mouseUpEventResult = WebInputEventResult::NotHandled; |
| 1936 if (!m_suppressMouseEventsFromGestures) | |
| 1937 mouseUpEventResult = dispatchMouseEvent(EventTypeNames::mouseup, current HitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp); | |
| 1920 | 1938 |
| 1921 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; | 1939 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; |
| 1922 if (m_clickNode) { | 1940 if (m_clickNode) { |
| 1923 if (currentHitTest.innerNode()) { | 1941 if (currentHitTest.innerNode()) { |
| 1924 // Updates distribution because a mouseup (or mousedown) event liste ner can make the | 1942 // Updates distribution because a mouseup (or mousedown) event liste ner can make the |
| 1925 // tree dirty at dispatchMouseEvent() invocation above. | 1943 // tree dirty at dispatchMouseEvent() invocation above. |
| 1926 // Unless distribution is updated, commonAncestor would hit ASSERT. | 1944 // Unless distribution is updated, commonAncestor would hit ASSERT. |
| 1927 // Both m_clickNode and currentHitTest.innerNode()) don't need to be updated | 1945 // Both m_clickNode and currentHitTest.innerNode()) don't need to be updated |
| 1928 // because commonAncestor() will exit early if their documents are d ifferent. | 1946 // because commonAncestor() will exit early if their documents are d ifferent. |
| 1929 m_clickNode->updateDistribution(); | 1947 m_clickNode->updateDistribution(); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 1953 IntPoint adjustedPoint = gestureEvent.position(); | 1971 IntPoint adjustedPoint = gestureEvent.position(); |
| 1954 | 1972 |
| 1955 unsigned modifiers = gestureEvent.getModifiers(); | 1973 unsigned modifiers = gestureEvent.getModifiers(); |
| 1956 | 1974 |
| 1957 // FIXME: Ideally we should try to remove the extra mouse-specific hit-tests here (re-using the | 1975 // FIXME: Ideally we should try to remove the extra mouse-specific hit-tests here (re-using the |
| 1958 // supplied HitTestResult), but that will require some overhaul of the touch drag-and-drop code | 1976 // supplied HitTestResult), but that will require some overhaul of the touch drag-and-drop code |
| 1959 // and LongPress is such a special scenario that it's unlikely to matter muc h in practice. | 1977 // and LongPress is such a special scenario that it's unlikely to matter muc h in practice. |
| 1960 | 1978 |
| 1961 m_longTapShouldInvokeContextMenu = false; | 1979 m_longTapShouldInvokeContextMenu = false; |
| 1962 if (m_frame->settings() && m_frame->settings()->touchDragDropEnabled() && m_ frame->view()) { | 1980 if (m_frame->settings() && m_frame->settings()->touchDragDropEnabled() && m_ frame->view()) { |
| 1981 // TODO(mustaq): Suppressing long-tap MouseEvents could break | |
| 1982 // drag-drop. Will do separately because of the risk. crbug.com/606938. | |
| 1963 PlatformMouseEvent mouseDownEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MousePressed, 1, | 1983 PlatformMouseEvent mouseDownEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MousePressed, 1, |
| 1964 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), | 1984 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), |
| 1965 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); | 1985 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); |
| 1966 m_mouseDown = mouseDownEvent; | 1986 m_mouseDown = mouseDownEvent; |
| 1967 | 1987 |
| 1968 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1, | 1988 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1, |
| 1969 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), | 1989 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), |
| 1970 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); | 1990 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); |
| 1971 HitTestRequest request(HitTestRequest::ReadOnly); | 1991 HitTestRequest request(HitTestRequest::ReadOnly); |
| 1972 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseDragE vent); | 1992 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseDragE vent); |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3082 if (!rect.contains(roundedIntPoint(point))) | 3102 if (!rect.contains(roundedIntPoint(point))) |
| 3083 return result; | 3103 return result; |
| 3084 } | 3104 } |
| 3085 frame->contentLayoutItem().hitTest(result); | 3105 frame->contentLayoutItem().hitTest(result); |
| 3086 return result; | 3106 return result; |
| 3087 } | 3107 } |
| 3088 | 3108 |
| 3089 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve nt) | 3109 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve nt) |
| 3090 { | 3110 { |
| 3091 TRACE_EVENT0("blink", "EventHandler::handleTouchEvent"); | 3111 TRACE_EVENT0("blink", "EventHandler::handleTouchEvent"); |
| 3092 | |
| 3093 return m_pointerEventManager.handleTouchEvents(event); | 3112 return m_pointerEventManager.handleTouchEvents(event); |
| 3094 } | 3113 } |
| 3095 | 3114 |
| 3096 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) | 3115 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) |
| 3097 { | 3116 { |
| 3098 m_mousePositionIsUnknown = false; | 3117 m_mousePositionIsUnknown = false; |
| 3099 m_lastKnownMousePosition = event.position(); | 3118 m_lastKnownMousePosition = event.position(); |
| 3100 m_lastKnownMouseGlobalPosition = event.globalPosition(); | 3119 m_lastKnownMouseGlobalPosition = event.globalPosition(); |
| 3101 } | 3120 } |
| 3102 | 3121 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3151 | 3170 |
| 3152 FrameHost* EventHandler::frameHost() const | 3171 FrameHost* EventHandler::frameHost() const |
| 3153 { | 3172 { |
| 3154 if (!m_frame->page()) | 3173 if (!m_frame->page()) |
| 3155 return nullptr; | 3174 return nullptr; |
| 3156 | 3175 |
| 3157 return &m_frame->page()->frameHost(); | 3176 return &m_frame->page()->frameHost(); |
| 3158 } | 3177 } |
| 3159 | 3178 |
| 3160 } // namespace blink | 3179 } // namespace blink |
| OLD | NEW |