Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1989623002: Suppressed MEs for gestures from cancelled PEs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a comment. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 , m_shouldOnlyFireDragOverEvent(false) 254 , m_shouldOnlyFireDragOverEvent(false)
255 , m_mousePositionIsUnknown(true) 255 , m_mousePositionIsUnknown(true)
256 , m_mouseDownTimestamp(0) 256 , m_mouseDownTimestamp(0)
257 , m_pointerEventManager(frame) 257 , m_pointerEventManager(frame)
258 , m_scrollGestureHandlingNode(nullptr) 258 , m_scrollGestureHandlingNode(nullptr)
259 , m_lastGestureScrollOverWidget(false) 259 , m_lastGestureScrollOverWidget(false)
260 , m_longTapShouldInvokeContextMenu(false) 260 , m_longTapShouldInvokeContextMenu(false)
261 , m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired) 261 , m_activeIntervalTimer(this, &EventHandler::activeIntervalTimerFired)
262 , m_lastShowPressTimestamp(0) 262 , m_lastShowPressTimestamp(0)
263 , m_deltaConsumedForScrollSequence(false) 263 , m_deltaConsumedForScrollSequence(false)
264 , m_suppressMouseEventsFromGestures(false)
264 { 265 {
265 } 266 }
266 267
267 EventHandler::~EventHandler() 268 EventHandler::~EventHandler()
268 { 269 {
269 ASSERT(!m_fakeMouseMoveEventTimer.isActive()); 270 ASSERT(!m_fakeMouseMoveEventTimer.isActive());
270 } 271 }
271 272
272 DEFINE_TRACE(EventHandler) 273 DEFINE_TRACE(EventHandler)
273 { 274 {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 m_lastDeferredTapElement = nullptr; 328 m_lastDeferredTapElement = nullptr;
328 m_eventHandlerWillResetCapturingMouseEventsNode = false; 329 m_eventHandlerWillResetCapturingMouseEventsNode = false;
329 m_mouseDownMayStartAutoscroll = false; 330 m_mouseDownMayStartAutoscroll = false;
330 m_svgPan = false; 331 m_svgPan = false;
331 m_mouseDownPos = IntPoint(); 332 m_mouseDownPos = IntPoint();
332 m_mouseDownTimestamp = 0; 333 m_mouseDownTimestamp = 0;
333 m_longTapShouldInvokeContextMenu = false; 334 m_longTapShouldInvokeContextMenu = false;
334 m_dragStartPos = LayoutPoint(); 335 m_dragStartPos = LayoutPoint();
335 m_offsetFromResizeCorner = LayoutSize(); 336 m_offsetFromResizeCorner = LayoutSize();
336 m_mouseDown = PlatformMouseEvent(); 337 m_mouseDown = PlatformMouseEvent();
338 m_suppressMouseEventsFromGestures = false;
337 } 339 }
338 340
339 WebInputEventResult EventHandler::mergeEventResult( 341 WebInputEventResult EventHandler::mergeEventResult(
340 WebInputEventResult resultA, WebInputEventResult resultB) 342 WebInputEventResult resultA, WebInputEventResult resultB)
341 { 343 {
342 // The ordering of the enumeration is specific. There are times that 344 // The ordering of the enumeration is specific. There are times that
343 // multiple events fire and we need to combine them into a single 345 // multiple events fire and we need to combine them into a single
344 // result code. The enumeration is based on the level of consumption that 346 // result code. The enumeration is based on the level of consumption that
345 // is most significant. The enumeration is ordered with smaller specified 347 // is most significant. The enumeration is ordered with smaller specified
346 // numbers first. Examples of merged results are: 348 // numbers first. Examples of merged results are:
(...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after
2056 if (gestureDomEvent) { 2058 if (gestureDomEvent) {
2057 DispatchEventResult gestureDomEventResult = eventTarget->dispatchEve nt(gestureDomEvent); 2059 DispatchEventResult gestureDomEventResult = eventTarget->dispatchEve nt(gestureDomEvent);
2058 if (gestureDomEventResult != DispatchEventResult::NotCanceled) { 2060 if (gestureDomEventResult != DispatchEventResult::NotCanceled) {
2059 ASSERT(gestureDomEventResult != DispatchEventResult::CanceledByE ventHandler); 2061 ASSERT(gestureDomEventResult != DispatchEventResult::CanceledByE ventHandler);
2060 return toWebInputEventResult(gestureDomEventResult); 2062 return toWebInputEventResult(gestureDomEventResult);
2061 } 2063 }
2062 } 2064 }
2063 } 2065 }
2064 2066
2065 switch (gestureEvent.type()) { 2067 switch (gestureEvent.type()) {
2068 case PlatformEvent::GestureTapDown:
2069 return handleGestureTapDown(targetedEvent);
2066 case PlatformEvent::GestureTap: 2070 case PlatformEvent::GestureTap:
2067 return handleGestureTap(targetedEvent); 2071 return handleGestureTap(targetedEvent);
2068 case PlatformEvent::GestureShowPress: 2072 case PlatformEvent::GestureShowPress:
2069 return handleGestureShowPress(); 2073 return handleGestureShowPress();
2070 case PlatformEvent::GestureLongPress: 2074 case PlatformEvent::GestureLongPress:
2071 return handleGestureLongPress(targetedEvent); 2075 return handleGestureLongPress(targetedEvent);
2072 case PlatformEvent::GestureLongTap: 2076 case PlatformEvent::GestureLongTap:
2073 return handleGestureLongTap(targetedEvent); 2077 return handleGestureLongTap(targetedEvent);
2074 case PlatformEvent::GestureTwoFingerTap: 2078 case PlatformEvent::GestureTwoFingerTap:
2075 return sendContextMenuEventForGesture(targetedEvent); 2079 return sendContextMenuEventForGesture(targetedEvent);
2076 case PlatformEvent::GestureTapDown:
2077 case PlatformEvent::GesturePinchBegin: 2080 case PlatformEvent::GesturePinchBegin:
2078 case PlatformEvent::GesturePinchEnd: 2081 case PlatformEvent::GesturePinchEnd:
2079 case PlatformEvent::GesturePinchUpdate: 2082 case PlatformEvent::GesturePinchUpdate:
2080 case PlatformEvent::GestureTapDownCancel: 2083 case PlatformEvent::GestureTapDownCancel:
2081 case PlatformEvent::GestureTapUnconfirmed: 2084 case PlatformEvent::GestureTapUnconfirmed:
2082 break; 2085 break;
2083 default: 2086 default:
2084 ASSERT_NOT_REACHED(); 2087 ASSERT_NOT_REACHED();
2085 } 2088 }
2086 2089
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
2154 case PlatformEvent::GesturePinchBegin: 2157 case PlatformEvent::GesturePinchBegin:
2155 case PlatformEvent::GesturePinchEnd: 2158 case PlatformEvent::GesturePinchEnd:
2156 case PlatformEvent::GesturePinchUpdate: 2159 case PlatformEvent::GesturePinchUpdate:
2157 return WebInputEventResult::NotHandled; 2160 return WebInputEventResult::NotHandled;
2158 default: 2161 default:
2159 ASSERT_NOT_REACHED(); 2162 ASSERT_NOT_REACHED();
2160 return WebInputEventResult::NotHandled; 2163 return WebInputEventResult::NotHandled;
2161 } 2164 }
2162 } 2165 }
2163 2166
2167 WebInputEventResult EventHandler::handleGestureTapDown(const GestureEventWithHit TestResults& targetedEvent)
2168 {
2169 m_suppressMouseEventsFromGestures =
2170 m_pointerEventManager.primaryPointerdownCanceled(targetedEvent.event().u niqueTouchEventId());
2171 return WebInputEventResult::NotHandled;
2172 }
2173
2164 WebInputEventResult EventHandler::handleGestureTap(const GestureEventWithHitTest Results& targetedEvent) 2174 WebInputEventResult EventHandler::handleGestureTap(const GestureEventWithHitTest Results& targetedEvent)
2165 { 2175 {
2166 FrameView* frameView(m_frame->view()); 2176 FrameView* frameView(m_frame->view());
2167 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); 2177 const PlatformGestureEvent& gestureEvent = targetedEvent.event();
2168 HitTestRequest::HitTestRequestType hitType = getHitTypeForGestureType(gestur eEvent.type()); 2178 HitTestRequest::HitTestRequestType hitType = getHitTypeForGestureType(gestur eEvent.type());
2169 uint64_t preDispatchDomTreeVersion = m_frame->document()->domTreeVersion(); 2179 uint64_t preDispatchDomTreeVersion = m_frame->document()->domTreeVersion();
2170 uint64_t preDispatchStyleVersion = m_frame->document()->styleVersion(); 2180 uint64_t preDispatchStyleVersion = m_frame->document()->styleVersion();
2171 2181
2172 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture); 2182 UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
2173 2183
2174 HitTestResult currentHitTest = targetedEvent.hitTestResult(); 2184 HitTestResult currentHitTest = targetedEvent.hitTestResult();
2175 2185
2176 // We use the adjusted position so the application isn't surprised to see a event with 2186 // We use the adjusted position so the application isn't surprised to see a event with
2177 // co-ordinates outside the target's bounds. 2187 // co-ordinates outside the target's bounds.
2178 IntPoint adjustedPoint = frameView->rootFrameToContents(gestureEvent.positio n()); 2188 IntPoint adjustedPoint = frameView->rootFrameToContents(gestureEvent.positio n());
2179 2189
2180 unsigned modifiers = gestureEvent.getModifiers(); 2190 const unsigned modifiers = gestureEvent.getModifiers();
2181 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.globa lPosition(), 2191
2182 NoButton, PlatformEvent::MouseMoved, /* clickCount */ 0, 2192 if (!m_suppressMouseEventsFromGestures) {
2183 static_cast<PlatformEvent::Modifiers>(modifiers), 2193 PlatformMouseEvent fakeMouseMove(gestureEvent.position(), gestureEvent.g lobalPosition(),
2184 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerPrope rties::PointerType::Mouse); 2194 NoButton, PlatformEvent::MouseMoved, /* clickCount */ 0,
2185 dispatchMouseEvent(EventTypeNames::mousemove, currentHitTest.innerNode(), 0, fakeMouseMove); 2195 static_cast<PlatformEvent::Modifiers>(modifiers),
2196 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerP roperties::PointerType::Mouse);
2197 dispatchMouseEvent(EventTypeNames::mousemove, currentHitTest.innerNode() , 0, fakeMouseMove);
2198 }
2186 2199
2187 // Do a new hit-test in case the mousemove event changed the DOM. 2200 // Do a new hit-test in case the mousemove event changed the DOM.
2188 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we 2201 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we
2189 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page 2202 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page
2190 // could have seen the event anyway). 2203 // could have seen the event anyway).
2191 // Also note that the position of the frame may have changed, so we need to recompute the content 2204 // Also note that the position of the frame may have changed, so we need to recompute the content
2192 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d). 2205 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d).
2193 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 2206 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920
2194 if (currentHitTest.innerNode()) { 2207 if (currentHitTest.innerNode()) {
2195 LocalFrame* mainFrame = m_frame->localFrameRoot(); 2208 LocalFrame* mainFrame = m_frame->localFrameRoot();
2196 if (mainFrame && mainFrame->view()) 2209 if (mainFrame && mainFrame->view())
2197 mainFrame->view()->updateLifecycleToCompositingCleanPlusScrolling(); 2210 mainFrame->view()->updateLifecycleToCompositingCleanPlusScrolling();
2198 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); 2211 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position());
2199 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); 2212 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType);
2200 } 2213 }
2201 m_clickNode = currentHitTest.innerNode(); 2214 m_clickNode = currentHitTest.innerNode();
2202 2215
2203 // Capture data for showUnhandledTapUIIfNeeded. 2216 // Capture data for showUnhandledTapUIIfNeeded.
2204 Node* tappedNode = m_clickNode; 2217 Node* tappedNode = m_clickNode;
2205 IntPoint tappedPosition = gestureEvent.position(); 2218 IntPoint tappedPosition = gestureEvent.position();
2206 2219
2207 if (m_clickNode && m_clickNode->isTextNode()) 2220 if (m_clickNode && m_clickNode->isTextNode())
2208 m_clickNode = FlatTreeTraversal::parent(*m_clickNode); 2221 m_clickNode = FlatTreeTraversal::parent(*m_clickNode);
2209 2222
2210 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(), 2223 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(),
2211 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(), 2224 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(),
2212 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut tonDown), 2225 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut tonDown),
2213 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerProp erties::PointerType::Mouse); 2226 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerPrope rties::PointerType::Mouse);
2214 WebInputEventResult mouseDownEventResult = dispatchMouseEvent(EventTypeNames ::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown) ; 2227 WebInputEventResult mouseDownEventResult = WebInputEventResult::NotHandled;
2228 if (!m_suppressMouseEventsFromGestures)
2229 mouseDownEventResult = dispatchMouseEvent(EventTypeNames::mousedown, cur rentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown);
2215 selectionController().initializeSelectionState(); 2230 selectionController().initializeSelectionState();
2216 if (mouseDownEventResult == WebInputEventResult::NotHandled) 2231 if (mouseDownEventResult == WebInputEventResult::NotHandled)
2217 mouseDownEventResult = handleMouseFocus(MouseEventWithHitTestResults(fak eMouseDown, currentHitTest), InputDeviceCapabilities::firesTouchEventsSourceCapa bilities()); 2232 mouseDownEventResult = handleMouseFocus(MouseEventWithHitTestResults(fak eMouseDown, currentHitTest), InputDeviceCapabilities::firesTouchEventsSourceCapa bilities());
2218 if (mouseDownEventResult == WebInputEventResult::NotHandled) 2233 if (mouseDownEventResult == WebInputEventResult::NotHandled)
2219 mouseDownEventResult = handleMousePressEvent(MouseEventWithHitTestResult s(fakeMouseDown, currentHitTest)); 2234 mouseDownEventResult = handleMousePressEvent(MouseEventWithHitTestResult s(fakeMouseDown, currentHitTest));
2220 2235
2221 if (currentHitTest.innerNode()) { 2236 if (currentHitTest.innerNode()) {
2222 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap); 2237 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap);
2223 HitTestResult result = currentHitTest; 2238 HitTestResult result = currentHitTest;
2224 result.setToShadowHostIfInUserAgentShadowRoot(); 2239 result.setToShadowHostIfInUserAgentShadowRoot();
2225 m_frame->chromeClient().onMouseDown(result.innerNode()); 2240 m_frame->chromeClient().onMouseDown(result.innerNode());
2226 } 2241 }
2227 2242
2228 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 2243 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920
2229 if (currentHitTest.innerNode()) { 2244 if (currentHitTest.innerNode()) {
2230 LocalFrame* mainFrame = m_frame->localFrameRoot(); 2245 LocalFrame* mainFrame = m_frame->localFrameRoot();
2231 if (mainFrame && mainFrame->view()) 2246 if (mainFrame && mainFrame->view())
2232 mainFrame->view()->updateAllLifecyclePhases(); 2247 mainFrame->view()->updateAllLifecyclePhases();
2233 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); 2248 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position());
2234 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); 2249 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType);
2235 } 2250 }
2251
2236 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), 2252 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(),
2237 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), 2253 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(),
2238 static_cast<PlatformEvent::Modifiers>(modifiers), 2254 static_cast<PlatformEvent::Modifiers>(modifiers),
2239 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerProp erties::PointerType::Mouse); 2255 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerPrope rties::PointerType::Mouse);
2240 WebInputEventResult mouseUpEventResult = dispatchMouseEvent(EventTypeNames:: mouseup, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp); 2256 WebInputEventResult mouseUpEventResult = WebInputEventResult::NotHandled;
2257 if (!m_suppressMouseEventsFromGestures)
2258 mouseUpEventResult = dispatchMouseEvent(EventTypeNames::mouseup, current HitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp);
2241 2259
2242 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; 2260 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled;
2243 if (m_clickNode) { 2261 if (m_clickNode) {
2244 if (currentHitTest.innerNode()) { 2262 if (currentHitTest.innerNode()) {
2245 // Updates distribution because a mouseup (or mousedown) event liste ner can make the 2263 // Updates distribution because a mouseup (or mousedown) event liste ner can make the
2246 // tree dirty at dispatchMouseEvent() invocation above. 2264 // tree dirty at dispatchMouseEvent() invocation above.
2247 // Unless distribution is updated, commonAncestor would hit ASSERT. 2265 // Unless distribution is updated, commonAncestor would hit ASSERT.
2248 // Both m_clickNode and currentHitTest.innerNode()) don't need to be updated 2266 // Both m_clickNode and currentHitTest.innerNode()) don't need to be updated
2249 // because commonAncestor() will exit early if their documents are d ifferent. 2267 // because commonAncestor() will exit early if their documents are d ifferent.
2250 m_clickNode->updateDistribution(); 2268 m_clickNode->updateDistribution();
(...skipping 23 matching lines...) Expand all
2274 IntPoint adjustedPoint = gestureEvent.position(); 2292 IntPoint adjustedPoint = gestureEvent.position();
2275 2293
2276 unsigned modifiers = gestureEvent.getModifiers(); 2294 unsigned modifiers = gestureEvent.getModifiers();
2277 2295
2278 // FIXME: Ideally we should try to remove the extra mouse-specific hit-tests here (re-using the 2296 // FIXME: Ideally we should try to remove the extra mouse-specific hit-tests here (re-using the
2279 // supplied HitTestResult), but that will require some overhaul of the touch drag-and-drop code 2297 // supplied HitTestResult), but that will require some overhaul of the touch drag-and-drop code
2280 // and LongPress is such a special scenario that it's unlikely to matter muc h in practice. 2298 // and LongPress is such a special scenario that it's unlikely to matter muc h in practice.
2281 2299
2282 m_longTapShouldInvokeContextMenu = false; 2300 m_longTapShouldInvokeContextMenu = false;
2283 if (m_frame->settings() && m_frame->settings()->touchDragDropEnabled() && m_ frame->view()) { 2301 if (m_frame->settings() && m_frame->settings()->touchDragDropEnabled() && m_ frame->view()) {
2302 // TODO(mustaq): Suppressing long-tap MouseEvents could break
2303 // drag-drop. Will do separately because of the risk. crbug.com/606938.
2284 PlatformMouseEvent mouseDownEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MousePressed, 1, 2304 PlatformMouseEvent mouseDownEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MousePressed, 1,
2285 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), 2305 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown),
2286 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); 2306 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse);
2287 m_mouseDown = mouseDownEvent; 2307 m_mouseDown = mouseDownEvent;
2288 2308
2289 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1, 2309 PlatformMouseEvent mouseDragEvent(adjustedPoint, gestureEvent.globalPosi tion(), LeftButton, PlatformEvent::MouseMoved, 1,
2290 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown), 2310 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::Lef tButtonDown),
2291 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse); 2311 PlatformMouseEvent::FromTouch, WTF::monotonicallyIncreasingTime(), W ebPointerProperties::PointerType::Mouse);
2292 HitTestRequest request(HitTestRequest::ReadOnly); 2312 HitTestRequest request(HitTestRequest::ReadOnly);
2293 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseDragE vent); 2313 MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseDragE vent);
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
3631 if (!rect.contains(roundedIntPoint(point))) 3651 if (!rect.contains(roundedIntPoint(point)))
3632 return result; 3652 return result;
3633 } 3653 }
3634 frame->contentLayoutItem().hitTest(result); 3654 frame->contentLayoutItem().hitTest(result);
3635 return result; 3655 return result;
3636 } 3656 }
3637 3657
3638 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve nt) 3658 WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve nt)
3639 { 3659 {
3640 TRACE_EVENT0("blink", "EventHandler::handleTouchEvent"); 3660 TRACE_EVENT0("blink", "EventHandler::handleTouchEvent");
3641
3642 return m_pointerEventManager.handleTouchEvents(event); 3661 return m_pointerEventManager.handleTouchEvents(event);
3643 } 3662 }
3644 3663
3645 void EventHandler::userGestureUtilized() 3664 void EventHandler::userGestureUtilized()
3646 { 3665 {
3647 // This is invoked for UserGestureIndicators created in TouchEventManger::ha ndleTouchEvent which perhaps 3666 // This is invoked for UserGestureIndicators created in TouchEventManger::ha ndleTouchEvent which perhaps
3648 // represent touch actions which shouldn't be considered a user-gesture. 3667 // represent touch actions which shouldn't be considered a user-gesture.
3649 UseCounter::count(m_frame, UseCounter::TouchDragUserGestureUsed); 3668 UseCounter::count(m_frame, UseCounter::TouchDragUserGestureUsed);
3650 } 3669 }
3651 3670
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
3707 3726
3708 FrameHost* EventHandler::frameHost() const 3727 FrameHost* EventHandler::frameHost() const
3709 { 3728 {
3710 if (!m_frame->page()) 3729 if (!m_frame->page())
3711 return nullptr; 3730 return nullptr;
3712 3731
3713 return &m_frame->page()->frameHost(); 3732 return &m_frame->page()->frameHost();
3714 } 3733 }
3715 3734
3716 } // namespace blink 3735 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698