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

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

Issue 2343923003: Make event.composedPath() on window behave the same way as that on document (Closed)
Patch Set: rebased Created 4 years, 2 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
Index: third_party/WebKit/Source/core/events/Event.cpp
diff --git a/third_party/WebKit/Source/core/events/Event.cpp b/third_party/WebKit/Source/core/events/Event.cpp
index c064d720b68cff946929e817ea6c295611267688..d2ebd7fef9aa6ceb974f99a36bb4382d4a82b69d 100644
--- a/third_party/WebKit/Source/core/events/Event.cpp
+++ b/third_party/WebKit/Source/core/events/Event.cpp
@@ -327,10 +327,14 @@ HeapVector<Member<EventTarget>> Event::pathInternal(ScriptState* scriptState,
NOTREACHED();
}
- // Returns [window] for events that are directly dispatched to the window object;
- // e.g., window.load, pageshow, etc.
- if (LocalDOMWindow* window = m_currentTarget->toLocalDOMWindow())
+ if (LocalDOMWindow* window = m_currentTarget->toLocalDOMWindow()) {
+ if (m_eventPath && !m_eventPath->isEmpty()) {
+ return m_eventPath->topNodeEventContext()
+ .treeScopeEventContext()
+ .ensureEventPath(*m_eventPath);
+ }
return HeapVector<Member<EventTarget>>(1, window);
+ }
return HeapVector<Member<EventTarget>>();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/shadow-dom/event-composed-path.html ('k') | third_party/WebKit/Source/core/events/EventPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698