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

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

Issue 1894253002: Prevent sending click event for non primary button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing tests Created 4 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 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 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 #if OS(MACOSX) 1469 #if OS(MACOSX)
1470 // FIXME: The Mac port achieves the same behavior by checking whether the co ntext menu is currently open in WebPage::mouseEvent(). Consider merging the impl ementations. 1470 // FIXME: The Mac port achieves the same behavior by checking whether the co ntext menu is currently open in WebPage::mouseEvent(). Consider merging the impl ementations.
1471 if (mouseEvent.button() == LeftButton && mouseEvent.getModifiers() & Platfor mEvent::CtrlKey) 1471 if (mouseEvent.button() == LeftButton && mouseEvent.getModifiers() & Platfor mEvent::CtrlKey)
1472 contextMenuEvent = true; 1472 contextMenuEvent = true;
1473 #endif 1473 #endif
1474 1474
1475 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; 1475 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled;
1476 const bool shouldDispatchClickEvent = m_clickCount > 0 1476 const bool shouldDispatchClickEvent = m_clickCount > 0
1477 && !contextMenuEvent 1477 && !contextMenuEvent
1478 && mev.innerNode() && m_clickNode 1478 && mev.innerNode() && m_clickNode
1479 && mev.innerNode()->canParticipateInFlatTree() && m_clickNode->canPartic ipateInFlatTree() 1479 && mev.innerNode()->canParticipateInFlatTree()
1480 && !(selectionController().hasExtendedSelection() && isLinkSelection(mev )); 1480 && m_clickNode->canParticipateInFlatTree()
dtapuska 2016/04/22 18:32:30 This change just seems like formatting...
Navid Zolghadr 2016/04/22 19:09:58 Sure. I change it back to what it was.
1481 && !(selectionController().hasExtendedSelection()
1482 && isLinkSelection(mev));
1481 if (shouldDispatchClickEvent) { 1483 if (shouldDispatchClickEvent) {
1482 // Updates distribution because a 'mouseup' event listener can make the 1484 // Updates distribution because a 'mouseup' event listener can make the
1483 // tree dirty at dispatchMouseEvent() invocation above. 1485 // tree dirty at dispatchMouseEvent() invocation above.
1484 // Unless distribution is updated, commonAncestor would hit ASSERT. 1486 // Unless distribution is updated, commonAncestor would hit ASSERT.
1485 // Both m_clickNode and mev.innerNode() don't need to be updated 1487 // Both m_clickNode and mev.innerNode() don't need to be updated
1486 // because commonAncestor() will exit early if their documents are diffe rent. 1488 // because commonAncestor() will exit early if their documents are diffe rent.
1487 m_clickNode->updateDistribution(); 1489 m_clickNode->updateDistribution();
1488 if (Node* clickTargetNode = mev.innerNode()->commonAncestor( 1490 if (Node* clickTargetNode = mev.innerNode()->commonAncestor(
1489 *m_clickNode, parentForClickEvent)) { 1491 *m_clickNode, parentForClickEvent)) {
1490 1492
(...skipping 2658 matching lines...) Expand 10 before | Expand all | Expand 10 after
4149 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() 4151 PlatformEvent::Modifiers EventHandler::accessKeyModifiers()
4150 { 4152 {
4151 #if OS(MACOSX) 4153 #if OS(MACOSX)
4152 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey); 4154 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo rmEvent::AltKey);
4153 #else 4155 #else
4154 return PlatformEvent::AltKey; 4156 return PlatformEvent::AltKey;
4155 #endif 4157 #endif
4156 } 4158 }
4157 4159
4158 } // namespace blink 4160 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698