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 |
1894 selectionController().initializeSelectionState(); | 1907 // TODO(mustaq): We suppress MEs plus all it's side effects. What would that |
1895 if (mouseDownEventResult == WebInputEventResult::NotHandled) | 1908 // mean for for TEs? What's the right balance here? crbug.com/617255 |
1896 mouseDownEventResult = handleMouseFocus(MouseEventWithHitTestResults(fak eMouseDown, currentHitTest), InputDeviceCapabilities::firesTouchEventsSourceCapa bilities()); | 1909 WebInputEventResult mouseDownEventResult = WebInputEventResult::NotHandled; |
1897 if (mouseDownEventResult == WebInputEventResult::NotHandled) | 1910 if (!m_suppressMouseEventsFromGestures) { |
1898 mouseDownEventResult = handleMousePressEvent(MouseEventWithHitTestResult s(fakeMouseDown, currentHitTest)); | 1911 mouseDownEventResult = dispatchMouseEvent(EventTypeNames::mousedown, cur rentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown); |
1912 selectionController().initializeSelectionState(); | |
1913 if (mouseDownEventResult == WebInputEventResult::NotHandled) | |
1914 mouseDownEventResult = handleMouseFocus(MouseEventWithHitTestResults (fakeMouseDown, currentHitTest), InputDeviceCapabilities::firesTouchEventsSource Capabilities()); | |
1915 if (mouseDownEventResult == WebInputEventResult::NotHandled) | |
1916 mouseDownEventResult = handleMousePressEvent(MouseEventWithHitTestRe sults(fakeMouseDown, currentHitTest)); | |
1917 } else { | |
1918 mouseDownEventResult = WebInputEventResult::HandledSuppressed; | |
Rick Byers
2016/06/09 17:01:33
nit: if you want to use if/else (instead of just i
mustaq
2016/06/09 17:17:28
Done.
| |
1919 } | |
1899 | 1920 |
1900 if (currentHitTest.innerNode()) { | 1921 if (currentHitTest.innerNode()) { |
1901 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap); | 1922 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap); |
1902 HitTestResult result = currentHitTest; | 1923 HitTestResult result = currentHitTest; |
1903 result.setToShadowHostIfInUserAgentShadowRoot(); | 1924 result.setToShadowHostIfInUserAgentShadowRoot(); |
1904 m_frame->chromeClient().onMouseDown(result.innerNode()); | 1925 m_frame->chromeClient().onMouseDown(result.innerNode()); |
1905 } | 1926 } |
1906 | 1927 |
1907 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 | 1928 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 |
1908 if (currentHitTest.innerNode()) { | 1929 if (currentHitTest.innerNode()) { |
1909 LocalFrame* mainFrame = m_frame->localFrameRoot(); | 1930 LocalFrame* mainFrame = m_frame->localFrameRoot(); |
1910 if (mainFrame && mainFrame->view()) | 1931 if (mainFrame && mainFrame->view()) |
1911 mainFrame->view()->updateAllLifecyclePhases(); | 1932 mainFrame->view()->updateAllLifecyclePhases(); |
1912 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); | 1933 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); |
1913 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); | 1934 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); |
1914 } | 1935 } |
1936 | |
1915 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), | 1937 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), |
1916 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), | 1938 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), |
1917 static_cast<PlatformEvent::Modifiers>(modifiers), | 1939 static_cast<PlatformEvent::Modifiers>(modifiers), |
1918 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerProp erties::PointerType::Mouse); | 1940 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerPrope rties::PointerType::Mouse); |
1919 WebInputEventResult mouseUpEventResult = dispatchMouseEvent(EventTypeNames:: mouseup, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp); | 1941 WebInputEventResult mouseUpEventResult = m_suppressMouseEventsFromGestures |
1942 ? WebInputEventResult::HandledSuppressed | |
1943 : dispatchMouseEvent(EventTypeNames::mouseup, currentHitTest.innerNode() , gestureEvent.tapCount(), fakeMouseUp); | |
1920 | 1944 |
1921 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; | 1945 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; |
1922 if (m_clickNode) { | 1946 if (m_clickNode) { |
1923 if (currentHitTest.innerNode()) { | 1947 if (currentHitTest.innerNode()) { |
1924 // Updates distribution because a mouseup (or mousedown) event liste ner can make the | 1948 // Updates distribution because a mouseup (or mousedown) event liste ner can make the |
1925 // tree dirty at dispatchMouseEvent() invocation above. | 1949 // tree dirty at dispatchMouseEvent() invocation above. |
1926 // Unless distribution is updated, commonAncestor would hit ASSERT. | 1950 // Unless distribution is updated, commonAncestor would hit ASSERT. |
1927 // Both m_clickNode and currentHitTest.innerNode()) don't need to be updated | 1951 // Both m_clickNode and currentHitTest.innerNode()) don't need to be updated |
1928 // because commonAncestor() will exit early if their documents are d ifferent. | 1952 // because commonAncestor() will exit early if their documents are d ifferent. |
1929 m_clickNode->updateDistribution(); | 1953 m_clickNode->updateDistribution(); |
(...skipping 23 matching lines...) Expand all Loading... | |
1953 IntPoint adjustedPoint = gestureEvent.position(); | 1977 IntPoint adjustedPoint = gestureEvent.position(); |
1954 | 1978 |
1955 unsigned modifiers = gestureEvent.getModifiers(); | 1979 unsigned modifiers = gestureEvent.getModifiers(); |
1956 | 1980 |
1957 // FIXME: Ideally we should try to remove the extra mouse-specific hit-tests here (re-using the | 1981 // 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 | 1982 // 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. | 1983 // and LongPress is such a special scenario that it's unlikely to matter muc h in practice. |
1960 | 1984 |
1961 m_longTapShouldInvokeContextMenu = false; | 1985 m_longTapShouldInvokeContextMenu = false; |
1962 if (m_frame->settings() && m_frame->settings()->touchDragDropEnabled() && m_ frame->view()) { | 1986 if (m_frame->settings() && m_frame->settings()->touchDragDropEnabled() && m_ frame->view()) { |
1987 // TODO(mustaq): Suppressing long-tap MouseEvents could break | |
1988 // drag-drop. Will do separately because of the risk. crbug.com/606938. | |
1963 PlatformMouseEvent mouseDownEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MousePressed, 1, | 1989 PlatformMouseEvent mouseDownEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MousePressed, 1, |
1964 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), | 1990 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), |
1965 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); | 1991 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); |
1966 m_mouseDown = mouseDownEvent; | 1992 m_mouseDown = mouseDownEvent; |
1967 | 1993 |
1968 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1, | 1994 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1, |
1969 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), | 1995 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), |
1970 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); | 1996 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); |
1971 HitTestRequest request(HitTestRequest::ReadOnly); | 1997 HitTestRequest request(HitTestRequest::ReadOnly); |
1972 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseDragE vent); | 1998 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))) | 3108 if (!rect.contains(roundedIntPoint(point))) |
3083 return result; | 3109 return result; |
3084 } | 3110 } |
3085 frame->contentLayoutItem().hitTest(result); | 3111 frame->contentLayoutItem().hitTest(result); |
3086 return result; | 3112 return result; |
3087 } | 3113 } |
3088 | 3114 |
3089 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve nt) | 3115 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve nt) |
3090 { | 3116 { |
3091 TRACE_EVENT0("blink", "EventHandler::handleTouchEvent"); | 3117 TRACE_EVENT0("blink", "EventHandler::handleTouchEvent"); |
3092 | |
3093 return m_pointerEventManager.handleTouchEvents(event); | 3118 return m_pointerEventManager.handleTouchEvents(event); |
3094 } | 3119 } |
3095 | 3120 |
3096 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) | 3121 void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event) |
3097 { | 3122 { |
3098 m_mousePositionIsUnknown = false; | 3123 m_mousePositionIsUnknown = false; |
3099 m_lastKnownMousePosition = event.position(); | 3124 m_lastKnownMousePosition = event.position(); |
3100 m_lastKnownMouseGlobalPosition = event.globalPosition(); | 3125 m_lastKnownMouseGlobalPosition = event.globalPosition(); |
3101 } | 3126 } |
3102 | 3127 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3151 | 3176 |
3152 FrameHost* EventHandler::frameHost() const | 3177 FrameHost* EventHandler::frameHost() const |
3153 { | 3178 { |
3154 if (!m_frame->page()) | 3179 if (!m_frame->page()) |
3155 return nullptr; | 3180 return nullptr; |
3156 | 3181 |
3157 return &m_frame->page()->frameHost(); | 3182 return &m_frame->page()->frameHost(); |
3158 } | 3183 } |
3159 | 3184 |
3160 } // namespace blink | 3185 } // namespace blink |
OLD | NEW |