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

Unified Diff: Source/core/events/Event.cpp

Issue 473833002: Don't emptify event.path after dispatching an event. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/shadow/event-path-expected.txt ('k') | Source/core/events/EventPath.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/Event.cpp
diff --git a/Source/core/events/Event.cpp b/Source/core/events/Event.cpp
index 51596c1fed3a19100645a67f464624f0b15b9522..664c3be8bf76960adde892cc84117c01ed4cdb7a 100644
--- a/Source/core/events/Event.cpp
+++ b/Source/core/events/Event.cpp
@@ -224,7 +224,17 @@ EventPath& Event::ensureEventPath()
PassRefPtrWillBeRawPtr<StaticNodeList> Event::path() const
{
- if (!m_currentTarget || !m_currentTarget->toNode())
+ if (!m_currentTarget) {
+ ASSERT(m_eventPhase == PhaseType::NONE);
+ if (!m_eventPath) {
+ // Before dispatching the event
+ return StaticNodeList::createEmpty();
+ }
+ ASSERT(!m_eventPath->isEmpty());
+ // After dispatching the event
+ return m_eventPath->last().treeScopeEventContext().ensureEventPath(*m_eventPath);
+ }
+ if (!m_currentTarget->toNode())
return StaticNodeList::createEmpty();
Node* node = m_currentTarget->toNode();
// FIXME: Support SVG Elements.
« no previous file with comments | « LayoutTests/fast/dom/shadow/event-path-expected.txt ('k') | Source/core/events/EventPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698