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

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

Issue 1402133003: Skip updating nodeUnderMouse to clickTarget. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test. Created 5 years, 2 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/mouseenter-mouseleave-on-drag-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 #endif 1263 #endif
1264 1264
1265 bool swallowClickEvent = false; 1265 bool swallowClickEvent = false;
1266 if (m_clickCount > 0 && !contextMenuEvent && mev.innerNode() && m_clickNode && mev.innerNode()->canParticipateInComposedTree() && m_clickNode->canParticipat eInComposedTree()) { 1266 if (m_clickCount > 0 && !contextMenuEvent && mev.innerNode() && m_clickNode && mev.innerNode()->canParticipateInComposedTree() && m_clickNode->canParticipat eInComposedTree()) {
1267 // Updates distribution because a 'mouseup' event listener can make the 1267 // Updates distribution because a 'mouseup' event listener can make the
1268 // tree dirty at dispatchMouseEvent() invocation above. 1268 // tree dirty at dispatchMouseEvent() invocation above.
1269 // Unless distribution is updated, commonAncestor would hit ASSERT. 1269 // Unless distribution is updated, commonAncestor would hit ASSERT.
1270 // Both m_clickNode and mev.innerNode() don't need to be updated 1270 // Both m_clickNode and mev.innerNode() don't need to be updated
1271 // because commonAncestor() will exit early if their documents are diffe rent. 1271 // because commonAncestor() will exit early if their documents are diffe rent.
1272 m_clickNode->updateDistribution(); 1272 m_clickNode->updateDistribution();
1273 if (Node* clickTargetNode = mev.innerNode()->commonAncestor(*m_clickNode , parentForClickEvent)) 1273 if (Node* clickTargetNode = mev.innerNode()->commonAncestor(
1274 swallowClickEvent = !dispatchMouseEvent(EventTypeNames::click, click TargetNode, m_clickCount, mouseEvent); 1274 *m_clickNode, parentForClickEvent)) {
1275
1276 // Dispatch mouseup directly w/o calling updateMouseEventTargetNode
1277 // because the mouseup dispatch above has already updated it
1278 // correctly. Moreover, clickTargetNode is different from
1279 // mev.innerNode at drag-release.
1280 clickTargetNode->dispatchMouseEvent(mouseEvent,
1281 EventTypeNames::click, m_clickCount);
1282 }
1275 } 1283 }
1276 1284
1277 if (m_resizeScrollableArea) { 1285 if (m_resizeScrollableArea) {
1278 m_resizeScrollableArea->setInResizeMode(false); 1286 m_resizeScrollableArea->setInResizeMode(false);
1279 m_resizeScrollableArea = nullptr; 1287 m_resizeScrollableArea = nullptr;
1280 } 1288 }
1281 1289
1282 bool swallowMouseReleaseEvent = false; 1290 bool swallowMouseReleaseEvent = false;
1283 if (!swallowMouseUpEvent) 1291 if (!swallowMouseUpEvent)
1284 swallowMouseReleaseEvent = handleMouseReleaseEvent(mev); 1292 swallowMouseReleaseEvent = handleMouseReleaseEvent(mev);
(...skipping 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after
4038 unsigned EventHandler::accessKeyModifiers() 4046 unsigned EventHandler::accessKeyModifiers()
4039 { 4047 {
4040 #if OS(MACOSX) 4048 #if OS(MACOSX)
4041 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4049 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4042 #else 4050 #else
4043 return PlatformEvent::AltKey; 4051 return PlatformEvent::AltKey;
4044 #endif 4052 #endif
4045 } 4053 }
4046 4054
4047 } // namespace blink 4055 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/mouseenter-mouseleave-on-drag-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698