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

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 23060022: Don't turn middleclicks into click events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed tests that no longer added any value. Created 7 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 | « LayoutTests/fast/events/script-tests/mouse-click-events.js ('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 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 return true; 1675 return true;
1676 1676
1677 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, mev. targetNode(), true, m_clickCount, mouseEvent, false); 1677 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, mev. targetNode(), true, m_clickCount, mouseEvent, false);
1678 1678
1679 bool contextMenuEvent = mouseEvent.button() == RightButton; 1679 bool contextMenuEvent = mouseEvent.button() == RightButton;
1680 #if OS(MACOSX) 1680 #if OS(MACOSX)
1681 // 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. 1681 // 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.
1682 if (mouseEvent.button() == LeftButton && mouseEvent.modifiers() & PlatformEv ent::CtrlKey) 1682 if (mouseEvent.button() == LeftButton && mouseEvent.modifiers() & PlatformEv ent::CtrlKey)
1683 contextMenuEvent = true; 1683 contextMenuEvent = true;
1684 #endif 1684 #endif
1685 1685 bool swallowClickEvent = false;
1686 bool swallowClickEvent = m_clickCount > 0 && !contextMenuEvent && mouseIsRel easedOnPressedElement(mev.targetNode(), m_clickNode.get()) && !dispatchMouseEven t(EventTypeNames::click, mev.targetNode(), true, m_clickCount, mouseEvent, true) ; 1686 if (m_clickCount > 0 && !contextMenuEvent && mouseEvent.button() != MiddleBu tton && mouseIsReleasedOnPressedElement(mev.targetNode(), m_clickNode.get())) {
1687 // Turn the Mouse Button Released event into a click event since all req uirements are fulfilled.
1688 swallowClickEvent = !dispatchMouseEvent(EventTypeNames::click, mev.targe tNode(), true, m_clickCount, mouseEvent, true);
1689 }
1687 1690
1688 if (m_resizeLayer) { 1691 if (m_resizeLayer) {
1689 m_resizeLayer->setInResizeMode(false); 1692 m_resizeLayer->setInResizeMode(false);
1690 m_resizeLayer = 0; 1693 m_resizeLayer = 0;
1691 } 1694 }
1692 1695
1693 bool swallowMouseReleaseEvent = false; 1696 bool swallowMouseReleaseEvent = false;
1694 if (!swallowMouseUpEvent) 1697 if (!swallowMouseUpEvent)
1695 swallowMouseReleaseEvent = handleMouseReleaseEvent(mev); 1698 swallowMouseReleaseEvent = handleMouseReleaseEvent(mev);
1696 1699
(...skipping 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after
3863 unsigned EventHandler::accessKeyModifiers() 3866 unsigned EventHandler::accessKeyModifiers()
3864 { 3867 {
3865 #if OS(MACOSX) 3868 #if OS(MACOSX)
3866 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3869 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3867 #else 3870 #else
3868 return PlatformEvent::AltKey; 3871 return PlatformEvent::AltKey;
3869 #endif 3872 #endif
3870 } 3873 }
3871 3874
3872 } // namespace WebCore 3875 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/script-tests/mouse-click-events.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698