Modified: trunk/Source/WebCore/ChangeLog (125625 => 125626)
--- trunk/Source/WebCore/ChangeLog 2012-08-15 00:33:21 UTC (rev 125625)
+++ trunk/Source/WebCore/ChangeLog 2012-08-15 00:56:02 UTC (rev 125626)
@@ -1,3 +1,17 @@
+2012-08-14 Hayato Ito <[email protected]>
+
+ Refactor EventDispatcher, moving code to make actual changes easier to review later.
+ https://bugs.webkit.org/show_bug.cgi?id=93959
+
+ Reviewed by Dimitri Glazkov.
+
+ No new tests - no new functionality.
+
+ * dom/EventDispatcher.cpp:
+ (WebCore::EventDispatcher::dispatchScopedEvent):
+ (WebCore):
+ (WebCore::EventDispatcher::dispatchSimulatedClick):
+
2012-08-14 Kihong Kwon <[email protected]>
Clear pattern to prevent timing problem between cancelVibration and vibrate
Modified: trunk/Source/WebCore/dom/EventDispatcher.cpp (125625 => 125626)
--- trunk/Source/WebCore/dom/EventDispatcher.cpp 2012-08-15 00:33:21 UTC (rev 125625)
+++ trunk/Source/WebCore/dom/EventDispatcher.cpp 2012-08-15 00:56:02 UTC (rev 125626)
@@ -151,39 +151,6 @@
return referenceNode;
}
-void EventDispatcher::dispatchScopedEvent(Node* node, PassRefPtr<EventDispatchMediator> mediator)
-{
- // We need to set the target here because it can go away by the time we actually fire the event.
- mediator->event()->setTarget(eventTargetRespectingSVGTargetRules(node));
- ScopedEventQueue::instance()->enqueueEventDispatchMediator(mediator);
-}
-
-void EventDispatcher::dispatchSimulatedClick(Node* node, PassRefPtr<Event> underlyingEvent, bool sendMouseEvents, bool showPressedLook)
-{
- if (node->disabled())
- return;
-
- if (!gNodesDispatchingSimulatedClicks)
- gNodesDispatchingSimulatedClicks = new HashSet<Node*>;
- else if (gNodesDispatchingSimulatedClicks->contains(node))
- return;
-
- gNodesDispatchingSimulatedClicks->add(node);
-
- // send mousedown and mouseup before the click, if requested
- if (sendMouseEvents)
- EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mousedownEvent, node->document()->defaultView(), underlyingEvent));
- node->setActive(true, showPressedLook);
- if (sendMouseEvents)
- EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mouseupEvent, node->document()->defaultView(), underlyingEvent));
- node->setActive(false);
-
- // always send click
- EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().clickEvent, node->document()->defaultView(), underlyingEvent));
-
- gNodesDispatchingSimulatedClicks->remove(node);
-}
-
void EventDispatcher::adjustRelatedTarget(Event* event, PassRefPtr<EventTarget> prpRelatedTarget)
{
if (!prpRelatedTarget)
@@ -238,6 +205,39 @@
}
}
+void EventDispatcher::dispatchScopedEvent(Node* node, PassRefPtr<EventDispatchMediator> mediator)
+{
+ // We need to set the target here because it can go away by the time we actually fire the event.
+ mediator->event()->setTarget(eventTargetRespectingSVGTargetRules(node));
+ ScopedEventQueue::instance()->enqueueEventDispatchMediator(mediator);
+}
+
+void EventDispatcher::dispatchSimulatedClick(Node* node, PassRefPtr<Event> underlyingEvent, bool sendMouseEvents, bool showPressedLook)
+{
+ if (node->disabled())
+ return;
+
+ if (!gNodesDispatchingSimulatedClicks)
+ gNodesDispatchingSimulatedClicks = new HashSet<Node*>;
+ else if (gNodesDispatchingSimulatedClicks->contains(node))
+ return;
+
+ gNodesDispatchingSimulatedClicks->add(node);
+
+ // send mousedown and mouseup before the click, if requested
+ if (sendMouseEvents)
+ EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mousedownEvent, node->document()->defaultView(), underlyingEvent));
+ node->setActive(true, showPressedLook);
+ if (sendMouseEvents)
+ EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mouseupEvent, node->document()->defaultView(), underlyingEvent));
+ node->setActive(false);
+
+ // always send click
+ EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().clickEvent, node->document()->defaultView(), underlyingEvent));
+
+ gNodesDispatchingSimulatedClicks->remove(node);
+}
+
bool EventDispatcher::dispatchEvent(PassRefPtr<Event> prpEvent)
{
#ifndef NDEBUG