Index: Source/core/events/EventDispatcher.cpp |
diff --git a/Source/core/events/EventDispatcher.cpp b/Source/core/events/EventDispatcher.cpp |
index 75567c9b363f4439df74b6aee338baf55da8d647..73403214f84dff1b334164ef74e514c3c28fb6e1 100644 |
--- a/Source/core/events/EventDispatcher.cpp |
+++ b/Source/core/events/EventDispatcher.cpp |
@@ -87,11 +87,13 @@ void EventDispatcher::dispatchSimulatedClick(Node* node, Event* underlyingEvent, |
if (mouseEventOptions == SendMouseOverUpDownEvents) |
EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseover, node->document().domWindow(), underlyingEvent)).dispatch(); |
- if (mouseEventOptions != SendNoEvents) |
+ if (mouseEventOptions != SendNoEvents) { |
EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mousedown, node->document().domWindow(), underlyingEvent)).dispatch(); |
- node->setActive(true); |
- if (mouseEventOptions != SendNoEvents) |
+ node->setActive(true); |
EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseup, node->document().domWindow(), underlyingEvent)).dispatch(); |
+ } |
+ // Some elements (e.g. the color picker) may set active state to true before |
+ // calling this method and expect the state to be reset during the call. |
node->setActive(false); |
// always send click |