Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(833)

Side by Side Diff: third_party/WebKit/Source/core/events/EventDispatcher.cpp

Issue 2501333003: Event failed to dispatch after stopPropagation (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 * rights reserved. 6 * rights reserved.
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 .windowEventContext() 242 .windowEventContext()
243 .window() 243 .window()
244 ->getExecutionContext(), 244 ->getExecutionContext(),
245 UseCounter::EventCancelBubbleAffected); 245 UseCounter::EventCancelBubbleAffected);
246 } 246 }
247 } 247 }
248 248
249 inline void EventDispatcher::dispatchEventPostProcess( 249 inline void EventDispatcher::dispatchEventPostProcess(
250 EventDispatchHandlingState* preDispatchEventHandlerResult) { 250 EventDispatchHandlingState* preDispatchEventHandlerResult) {
251 m_event->setTarget(EventPath::eventTargetRespectingTargetRules(*m_node)); 251 m_event->setTarget(EventPath::eventTargetRespectingTargetRules(*m_node));
252 // https://dom.spec.whatwg.org/#concept-event-dispatch
253 // 16. Set event’s currentTarget attribute to null.
252 m_event->setCurrentTarget(nullptr); 254 m_event->setCurrentTarget(nullptr);
255 // 15. Set event’s eventPhase attribute to NONE.
253 m_event->setEventPhase(0); 256 m_event->setEventPhase(0);
257 // 14. Unset event’s dispatch flag, stop propagation flag, and stop immediate propagation flag.
hayato 2016/11/17 05:37:42 Could you reorder [16, 15, 14] to [14, 15, 16]?
258 m_event->clearStopPropagation();
259 m_event->clearStopImmediatePropagation();
254 260
255 // Pass the data from the preDispatchEventHandler to the 261 // Pass the data from the preDispatchEventHandler to the
256 // postDispatchEventHandler. 262 // postDispatchEventHandler.
257 m_node->postDispatchEventHandler(m_event.get(), 263 m_node->postDispatchEventHandler(m_event.get(),
258 preDispatchEventHandlerResult); 264 preDispatchEventHandlerResult);
259 265
260 bool isClick = m_event->isMouseEvent() && 266 bool isClick = m_event->isMouseEvent() &&
261 toMouseEvent(*m_event).type() == EventTypeNames::click; 267 toMouseEvent(*m_event).type() == EventTypeNames::click;
262 if (isClick) { 268 if (isClick) {
263 // Fire an accessibility event indicating a node was clicked on. This is 269 // Fire an accessibility event indicating a node was clicked on. This is
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 // events to open select boxes. 319 // events to open select boxes.
314 if (!m_event->isTrusted() && m_event->isMouseEvent() && 320 if (!m_event->isTrusted() && m_event->isMouseEvent() &&
315 m_event->type() == EventTypeNames::mousedown && 321 m_event->type() == EventTypeNames::mousedown &&
316 isHTMLSelectElement(*m_node)) { 322 isHTMLSelectElement(*m_node)) {
317 UseCounter::count(m_node->document(), 323 UseCounter::count(m_node->document(),
318 UseCounter::UntrustedMouseDownEventDispatchedToSelect); 324 UseCounter::UntrustedMouseDownEventDispatchedToSelect);
319 } 325 }
320 } 326 }
321 327
322 } // namespace blink 328 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698