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

Unified Diff: third_party/WebKit/Source/core/input/MouseEventManager.cpp

Issue 2771463002: Revert "Send click event after pointer capturing retarget" (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/input/MouseEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
index 924c1066419b7bcd970de57087f80315b6cc55e1..85f6eaecd3145df12c4a08e0afed61da5a5e9eff 100644
--- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -232,50 +232,50 @@ WebInputEventResult MouseEventManager::setMousePositionAndDispatchMouseEvent(
}
WebInputEventResult MouseEventManager::dispatchMouseClickIfNeeded(
- Node* target,
- const WebMouseEvent& mouseEvent,
- const String& canvasRegionId) {
+ const MouseEventWithHitTestResults& mev) {
// We only prevent click event when the click may cause contextmenu to popup.
// However, we always send auxclick.
bool contextMenuEvent =
!RuntimeEnabledFeatures::auxclickEnabled() &&
- mouseEvent.button == WebPointerProperties::Button::Right;
+ mev.event().button == WebPointerProperties::Button::Right;
#if OS(MACOSX)
// FIXME: The Mac port achieves the same behavior by checking whether the
// context menu is currently open in WebPage::mouseEvent(). Consider merging
// the implementations.
- if (mouseEvent.button == WebPointerProperties::Button::Left &&
- mouseEvent.modifiers() & WebInputEvent::Modifiers::ControlKey)
+ if (mev.event().button == WebPointerProperties::Button::Left &&
+ mev.event().modifiers() & WebInputEvent::Modifiers::ControlKey)
contextMenuEvent = true;
#endif
WebInputEventResult clickEventResult = WebInputEventResult::NotHandled;
- const bool shouldDispatchClickEvent = m_clickCount > 0 && !contextMenuEvent &&
- target && m_clickNode &&
- target->canParticipateInFlatTree() &&
- m_clickNode->canParticipateInFlatTree();
+ const bool shouldDispatchClickEvent =
+ m_clickCount > 0 && !contextMenuEvent && mev.innerNode() && m_clickNode &&
+ mev.innerNode()->canParticipateInFlatTree() &&
+ m_clickNode->canParticipateInFlatTree() &&
+ !(m_frame->eventHandler().selectionController().hasExtendedSelection() &&
+ isLinkSelection(mev));
if (shouldDispatchClickEvent) {
Node* clickTargetNode = nullptr;
// Updates distribution because a 'mouseup' event listener can make the
// tree dirty at dispatchMouseEvent() invocation above.
// Unless distribution is updated, commonAncestor would hit ASSERT.
- if (m_clickNode == target) {
+ if (m_clickNode == mev.innerNode()) {
clickTargetNode = m_clickNode;
clickTargetNode->updateDistribution();
- } else if (m_clickNode->document() == target->document()) {
+ } else if (m_clickNode->document() == mev.innerNode()->document()) {
m_clickNode->updateDistribution();
- target->updateDistribution();
- clickTargetNode = target->commonAncestor(
+ mev.innerNode()->updateDistribution();
+ clickTargetNode = mev.innerNode()->commonAncestor(
*m_clickNode, EventHandlingUtil::parentForClickEvent);
}
if (clickTargetNode) {
clickEventResult = dispatchMouseEvent(
clickTargetNode,
!RuntimeEnabledFeatures::auxclickEnabled() ||
- (mouseEvent.button == WebPointerProperties::Button::Left)
+ (mev.event().button == WebPointerProperties::Button::Left)
? EventTypeNames::click
: EventTypeNames::auxclick,
- mouseEvent, canvasRegionId, nullptr);
+ mev.event(), mev.canvasRegionId(), nullptr);
}
}
return clickEventResult;
@@ -575,8 +575,8 @@ WebInputEventResult MouseEventManager::handleMousePressEvent(
bool singleClick = event.event().clickCount <= 1;
- m_mouseDownMayStartDrag = singleClick && !isSelectionOverLink(event) &&
- !isExtendingSelection(event);
+ m_mouseDownMayStartDrag =
+ singleClick && !isLinkSelection(event) && !isExtendingSelection(event);
m_frame->eventHandler().selectionController().handleMousePressEvent(event);
« no previous file with comments | « third_party/WebKit/Source/core/input/MouseEventManager.h ('k') | third_party/WebKit/Source/core/input/PointerEventManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698