Changeset 125133 in webkit
- Timestamp:
- Aug 8, 2012 6:11:35 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r125132 r125133 1 2012-08-08 Hayato Ito <hayato@chromium.org> 2 3 EventDispatcher::dispatchSimulatedClick should not reuse the same EventDispatcher instance. 4 https://bugs.webkit.org/show_bug.cgi?id=93452 5 6 Reviewed by Dimitri Glazkov. 7 8 This is a follow up patch after r124975. There is yet another 9 place where the same EventDispatcher instance is reused across 10 event dispatching. 11 12 In addition to that, in order to simulate a real click, we must 13 different dispatchers because we must recalculate event ancestors 14 each time. Current implementation wrongly freezes event ancestors 15 at the first event dispatching. 16 17 No new tests, no change in functionality. 18 19 * dom/EventDispatcher.cpp: 20 (WebCore::EventDispatcher::dispatchSimulatedClick): 21 (WebCore::EventDispatcher::EventDispatcher): 22 (WebCore::EventDispatcher::dispatchEvent): 23 * dom/EventDispatcher.h: 24 (EventDispatcher): 25 1 26 2012-08-08 Jae Hyun Park <jae.park@company100.net> 2 27 -
trunk/Source/WebCore/dom/EventDispatcher.cpp
r124992 r125133 164 164 return; 165 165 166 EventDispatcher dispatcher(node);167 168 166 if (!gNodesDispatchingSimulatedClicks) 169 167 gNodesDispatchingSimulatedClicks = new HashSet<Node*>; … … 175 173 // send mousedown and mouseup before the click, if requested 176 174 if (sendMouseEvents) 177 dispatcher.dispatchEvent(SimulatedMouseEvent::create(eventNames().mousedownEvent, node->document()->defaultView(), underlyingEvent));175 EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mousedownEvent, node->document()->defaultView(), underlyingEvent)); 178 176 node->setActive(true, showPressedLook); 179 177 if (sendMouseEvents) 180 dispatcher.dispatchEvent(SimulatedMouseEvent::create(eventNames().mouseupEvent, node->document()->defaultView(), underlyingEvent));178 EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().mouseupEvent, node->document()->defaultView(), underlyingEvent)); 181 179 node->setActive(false); 182 180 183 181 // always send click 184 dispatcher.dispatchEvent(SimulatedMouseEvent::create(eventNames().clickEvent, node->document()->defaultView(), underlyingEvent));182 EventDispatcher(node).dispatchEvent(SimulatedMouseEvent::create(eventNames().clickEvent, node->document()->defaultView(), underlyingEvent)); 185 183 186 184 gNodesDispatchingSimulatedClicks->remove(node); … … 203 201 : m_node(node) 204 202 , m_ancestorsInitialized(false) 203 #ifndef NDEBUG 204 , m_eventDispatched(false) 205 #endif 205 206 { 206 207 ASSERT(node); … … 240 241 bool EventDispatcher::dispatchEvent(PassRefPtr<Event> prpEvent) 241 242 { 243 #ifndef NDEBUG 244 ASSERT(!m_eventDispatched); 245 m_eventDispatched = true; 246 #endif 242 247 RefPtr<Event> event = prpEvent; 243 248 ChildNodesLazySnapshot::takeChildNodesLazySnapshot(); -
trunk/Source/WebCore/dom/EventDispatcher.h
r124992 r125133 97 97 RefPtr<FrameView> m_view; 98 98 bool m_ancestorsInitialized; 99 #ifndef NDEBUG 100 bool m_eventDispatched; 101 #endif 99 102 }; 100 103
Note: See TracChangeset
for help on using the changeset viewer.