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

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

Issue 2501333003: Event failed to dispatch after stopPropagation (Closed)
Patch Set: After format. Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // 14. Unset event’s dispatch flag, stop propagation flag, and stop immediate
254 // propagation flag.
255 m_event->setStopPropagation(false);
256 m_event->setStopImmediatePropagation(false);
257 // 15. Set event’s eventPhase attribute to NONE.
258 m_event->setEventPhase(0);
259 // 16. Set event’s currentTarget attribute to null.
252 m_event->setCurrentTarget(nullptr); 260 m_event->setCurrentTarget(nullptr);
253 m_event->setEventPhase(0);
254 261
255 // Pass the data from the preDispatchEventHandler to the 262 // Pass the data from the preDispatchEventHandler to the
256 // postDispatchEventHandler. 263 // postDispatchEventHandler.
257 m_node->postDispatchEventHandler(m_event.get(), 264 m_node->postDispatchEventHandler(m_event.get(),
258 preDispatchEventHandlerResult); 265 preDispatchEventHandlerResult);
259 266
260 bool isClick = m_event->isMouseEvent() && 267 bool isClick = m_event->isMouseEvent() &&
261 toMouseEvent(*m_event).type() == EventTypeNames::click; 268 toMouseEvent(*m_event).type() == EventTypeNames::click;
262 if (isClick) { 269 if (isClick) {
263 // Fire an accessibility event indicating a node was clicked on. This is 270 // 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. 320 // events to open select boxes.
314 if (!m_event->isTrusted() && m_event->isMouseEvent() && 321 if (!m_event->isTrusted() && m_event->isMouseEvent() &&
315 m_event->type() == EventTypeNames::mousedown && 322 m_event->type() == EventTypeNames::mousedown &&
316 isHTMLSelectElement(*m_node)) { 323 isHTMLSelectElement(*m_node)) {
317 UseCounter::count(m_node->document(), 324 UseCounter::count(m_node->document(),
318 UseCounter::UntrustedMouseDownEventDispatchedToSelect); 325 UseCounter::UntrustedMouseDownEventDispatchedToSelect);
319 } 326 }
320 } 327 }
321 328
322 } // namespace blink 329 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698