Index: Source/core/events/EventDispatcher.cpp |
diff --git a/Source/core/events/EventDispatcher.cpp b/Source/core/events/EventDispatcher.cpp |
index 4608101c264a159845dfa964eb9e09c77dbb7310..a0a008c949a35dc443b0443354011ae66987fff4 100644 |
--- a/Source/core/events/EventDispatcher.cpp |
+++ b/Source/core/events/EventDispatcher.cpp |
@@ -206,7 +206,13 @@ inline void EventDispatcher::dispatchEventPostProcess(void* preDispatchEventHand |
// Call default event handlers. While the DOM does have a concept of preventing |
// default handling, the detail of which handlers are called is an internal |
// implementation detail and not part of the DOM. |
- if (!m_event->defaultPrevented() && !m_event->defaultHandled()) { |
+ |
+ // The DOM Events spec says that events dispatched by JS (other than "click") |
+ // should not have their default handlers invoked. (issue #423975) |
+ // To begin with, only apply to mouse events. |
+ bool isSyntheticMouseEventOtherThanClick = m_event->isMouseEvent() && toMouseEvent(*m_event).fromScript() && toMouseEvent(*m_event).type() != EventTypeNames::click; |
+ |
+ if (!m_event->defaultPrevented() && !m_event->defaultHandled() && !isSyntheticMouseEventOtherThanClick) { |
// Non-bubbling events call only one default event handler, the one for the target. |
m_node->willCallDefaultEventHandler(*m_event); |
m_node->defaultEventHandler(m_event.get()); |