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

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

Issue 2814343002: Fire a click event even when a clicked text node is removed in mouseup (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/input/MouseEventManager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8f40ad03be6edc37e9a1432a4b7190299c85598f..70ebeac64b5c4709cc8d02721347deb3828b6df3 100644
--- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -230,7 +230,8 @@ WebInputEventResult MouseEventManager::setMousePositionAndDispatchMouseEvent(
}
WebInputEventResult MouseEventManager::dispatchMouseClickIfNeeded(
- const MouseEventWithHitTestResults& mev) {
+ const MouseEventWithHitTestResults& mev,
+ Node* releaseNode) {
// We only prevent click event when the click may cause contextmenu to popup.
// However, we always send auxclick.
bool contextMenuEvent =
@@ -247,23 +248,22 @@ WebInputEventResult MouseEventManager::dispatchMouseClickIfNeeded(
WebInputEventResult clickEventResult = WebInputEventResult::NotHandled;
const bool shouldDispatchClickEvent =
- m_clickCount > 0 && !contextMenuEvent && mev.innerNode() && m_clickNode &&
- mev.innerNode()->canParticipateInFlatTree() &&
+ m_clickCount > 0 && !contextMenuEvent && releaseNode && m_clickNode &&
+ releaseNode->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 == mev.innerNode()) {
+ if (m_clickNode == releaseNode) {
clickTargetNode = m_clickNode;
- clickTargetNode->updateDistribution();
} else if (m_clickNode->document() == mev.innerNode()->document()) {
+ // Updates distribution because a 'mouseup' event listener can make the
+ // tree dirty at dispatchMouseEvent() invocation above.
+ // Unless distribution is updated, commonAncestor would hit ASSERT.
m_clickNode->updateDistribution();
mev.innerNode()->updateDistribution();
- clickTargetNode = mev.innerNode()->commonAncestor(
+ clickTargetNode = releaseNode->commonAncestor(
*m_clickNode, EventHandlingUtil::parentForClickEvent);
}
if (clickTargetNode) {
« no previous file with comments | « third_party/WebKit/Source/core/input/MouseEventManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698