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

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

Issue 2681443003: Send click event after pointer capturing retarget (Closed)
Patch Set: Rename the function and the parameter names Created 3 years, 9 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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 m_frame->localFrameRoot() 971 m_frame->localFrameRoot()
972 ->eventHandler() 972 ->eventHandler()
973 .m_lastMouseDownUserGestureToken.release())); 973 .m_lastMouseDownUserGestureToken.release()));
974 } else { 974 } else {
975 gestureIndicator = WTF::wrapUnique(new UserGestureIndicator( 975 gestureIndicator = WTF::wrapUnique(new UserGestureIndicator(
976 DocumentUserGestureToken::create(m_frame->document()))); 976 DocumentUserGestureToken::create(m_frame->document())));
977 } 977 }
978 978
979 WebInputEventResult eventResult = updatePointerTargetAndDispatchEvents( 979 WebInputEventResult eventResult = updatePointerTargetAndDispatchEvents(
980 EventTypeNames::mouseup, mev.innerNode(), mev.canvasRegionId(), 980 EventTypeNames::mouseup, mev.innerNode(), mev.canvasRegionId(),
981 mev.event(), Vector<WebMouseEvent>()); 981 mev.event(), Vector<WebMouseEvent>(),
982 982 !(selectionController().hasExtendedSelection() &&
983 WebInputEventResult clickEventResult = 983 isSelectionOverLink(mev)));
984 m_mouseEventManager->dispatchMouseClickIfNeeded(mev);
985 984
986 m_scrollManager->clearResizeScrollableArea(false); 985 m_scrollManager->clearResizeScrollableArea(false);
987 986
988 if (eventResult == WebInputEventResult::NotHandled) 987 if (eventResult == WebInputEventResult::NotHandled)
989 eventResult = m_mouseEventManager->handleMouseReleaseEvent(mev); 988 eventResult = m_mouseEventManager->handleMouseReleaseEvent(mev);
990 m_mouseEventManager->clearDragHeuristicState(); 989 m_mouseEventManager->clearDragHeuristicState();
991 990
992 m_mouseEventManager->invalidateClick(); 991 m_mouseEventManager->invalidateClick();
993 992
994 return EventHandlingUtil::mergeEventResult(clickEventResult, eventResult); 993 return eventResult;
995 } 994 }
996 995
997 static bool targetIsFrame(Node* target, LocalFrame*& frame) { 996 static bool targetIsFrame(Node* target, LocalFrame*& frame) {
998 if (!isHTMLFrameElementBase(target)) 997 if (!isHTMLFrameElementBase(target))
999 return false; 998 return false;
1000 999
1001 // Cross-process drag and drop is not yet supported. 1000 // Cross-process drag and drop is not yet supported.
1002 if (toHTMLFrameElementBase(target)->contentFrame() && 1001 if (toHTMLFrameElementBase(target)->contentFrame() &&
1003 !toHTMLFrameElementBase(target)->contentFrame()->isLocalFrame()) 1002 !toHTMLFrameElementBase(target)->contentFrame()->isLocalFrame())
1004 return false; 1003 return false;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 1258
1260 void EventHandler::elementRemoved(EventTarget* target) { 1259 void EventHandler::elementRemoved(EventTarget* target) {
1261 m_pointerEventManager->elementRemoved(target); 1260 m_pointerEventManager->elementRemoved(target);
1262 } 1261 }
1263 1262
1264 WebInputEventResult EventHandler::updatePointerTargetAndDispatchEvents( 1263 WebInputEventResult EventHandler::updatePointerTargetAndDispatchEvents(
1265 const AtomicString& mouseEventType, 1264 const AtomicString& mouseEventType,
1266 Node* targetNode, 1265 Node* targetNode,
1267 const String& canvasRegionId, 1266 const String& canvasRegionId,
1268 const WebMouseEvent& mouseEvent, 1267 const WebMouseEvent& mouseEvent,
1269 const Vector<WebMouseEvent>& coalescedEvents) { 1268 const Vector<WebMouseEvent>& coalescedEvents,
1269 bool selectionOverLink) {
1270 ASSERT(mouseEventType == EventTypeNames::mousedown || 1270 ASSERT(mouseEventType == EventTypeNames::mousedown ||
1271 mouseEventType == EventTypeNames::mousemove || 1271 mouseEventType == EventTypeNames::mousemove ||
1272 mouseEventType == EventTypeNames::mouseup); 1272 mouseEventType == EventTypeNames::mouseup);
1273 1273
1274 const auto& eventResult = m_pointerEventManager->sendMousePointerEvent( 1274 const auto& eventResult = m_pointerEventManager->sendMousePointerEvent(
1275 updateMouseEventTargetNode(targetNode), canvasRegionId, mouseEventType, 1275 updateMouseEventTargetNode(targetNode), canvasRegionId, mouseEventType,
1276 mouseEvent, coalescedEvents); 1276 mouseEvent, coalescedEvents, selectionOverLink);
1277 return eventResult; 1277 return eventResult;
1278 } 1278 }
1279 1279
1280 WebInputEventResult EventHandler::handleWheelEvent( 1280 WebInputEventResult EventHandler::handleWheelEvent(
1281 const WebMouseWheelEvent& event) { 1281 const WebMouseWheelEvent& event) {
1282 #if OS(MACOSX) 1282 #if OS(MACOSX)
1283 // Filter Mac OS specific phases, usually with a zero-delta. 1283 // Filter Mac OS specific phases, usually with a zero-delta.
1284 // https://crbug.com/553732 1284 // https://crbug.com/553732
1285 // TODO(chongz): EventSender sends events with 1285 // TODO(chongz): EventSender sends events with
1286 // |WebMouseWheelEvent::PhaseNone|, 1286 // |WebMouseWheelEvent::PhaseNone|,
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 } 2142 }
2143 2143
2144 FrameHost* EventHandler::frameHost() const { 2144 FrameHost* EventHandler::frameHost() const {
2145 if (!m_frame->page()) 2145 if (!m_frame->page())
2146 return nullptr; 2146 return nullptr;
2147 2147
2148 return &m_frame->page()->frameHost(); 2148 return &m_frame->page()->frameHost();
2149 } 2149 }
2150 2150
2151 } // namespace blink 2151 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.h ('k') | third_party/WebKit/Source/core/input/MouseEventManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698