Index: Source/core/page/EventHandler.cpp |
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp |
index 6194a5794262c63fe00e4e4d61d5e2904daa9d9f..0ae48eee81f728e08176cbb9630a37158d1e9798 100644 |
--- a/Source/core/page/EventHandler.cpp |
+++ b/Source/core/page/EventHandler.cpp |
@@ -1682,8 +1682,11 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent) |
if (mouseEvent.button() == LeftButton && mouseEvent.modifiers() & PlatformEvent::CtrlKey) |
contextMenuEvent = true; |
#endif |
- |
- bool swallowClickEvent = m_clickCount > 0 && !contextMenuEvent && mouseIsReleasedOnPressedElement(mev.targetNode(), m_clickNode.get()) && !dispatchMouseEvent(EventNames::click, mev.targetNode(), true, m_clickCount, mouseEvent, true); |
+ bool swallowClickEvent = false; |
+ if (m_clickCount > 0 && !contextMenuEvent && mouseEvent.button() != MiddleButton && mouseIsReleasedOnPressedElement(mev.targetNode(), m_clickNode.get())) { |
+ // Turn the Mouse Button Released event into a click event since all requirements are fulfilled. |
+ swallowClickEvent = !dispatchMouseEvent(EventNames::click, mev.targetNode(), true, m_clickCount, mouseEvent, true); |
+ } |
if (m_resizeLayer) { |
m_resizeLayer->setInResizeMode(false); |