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

Unified Diff: WebCore/page/EventHandler.cpp

Issue 3325025: Merge 67261 - Make middle clicks not fire DOM onclick events.... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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 | « WebCore/html/HTMLInputElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/page/EventHandler.cpp
===================================================================
--- WebCore/page/EventHandler.cpp (revision 67262)
+++ WebCore/page/EventHandler.cpp (working copy)
@@ -1375,18 +1375,13 @@
m_clickCount = mouseEvent.clickCount();
bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
- bool swallowClickEvent = false;
- // Don't ever dispatch click events for right clicks
- if (mouseEvent.button() != RightButton && mev.targetNode() == m_clickNode)
- swallowClickEvent = dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
+ bool swallowClickEvent = mouseEvent.button() == LeftButton && mev.targetNode() == m_clickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
if (m_lastScrollbarUnderMouse)
swallowMouseUpEvent = m_lastScrollbarUnderMouse->mouseUp();
-
- bool swallowMouseReleaseEvent = false;
- if (!swallowMouseUpEvent)
- swallowMouseReleaseEvent = handleMouseReleaseEvent(mev);
+ bool swallowMouseReleaseEvent = !swallowMouseUpEvent && handleMouseReleaseEvent(mev);
+
invalidateClick();
return swallowMouseUpEvent || swallowClickEvent || swallowMouseReleaseEvent;
@@ -1571,10 +1566,7 @@
bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
- // Don't ever dispatch click events for right clicks
- bool swallowClickEvent = false;
- if (m_clickCount > 0 && mouseEvent.button() != RightButton && mev.targetNode() == m_clickNode)
- swallowClickEvent = dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
+ bool swallowClickEvent = m_clickCount > 0 && mouseEvent.button() == LeftButton && mev.targetNode() == m_clickNode && dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
if (m_resizeLayer) {
m_resizeLayer->setInResizeMode(false);
« no previous file with comments | « WebCore/html/HTMLInputElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698