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

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

Issue 849783002: Event.path should include Window (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: comments fixed Created 5 years, 11 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
« Source/core/events/Event.cpp ('K') | « Source/core/events/TreeScopeEventContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/TreeScopeEventContext.cpp
diff --git a/Source/core/events/TreeScopeEventContext.cpp b/Source/core/events/TreeScopeEventContext.cpp
index bdf4c0fbed4690d62932af0a6b500b38df85007c..dd3cc9059a65cce786b9a81dc0c78b8400488b2e 100644
--- a/Source/core/events/TreeScopeEventContext.cpp
+++ b/Source/core/events/TreeScopeEventContext.cpp
@@ -34,22 +34,24 @@
namespace blink {
-PassRefPtrWillBeRawPtr<StaticNodeList> TreeScopeEventContext::ensureEventPath(EventPath& path)
+WillBeHeapVector<RefPtrWillBeRawPtr<EventTarget>>& TreeScopeEventContext::ensureEventPath(EventPath& path)
{
if (m_eventPath)
- return m_eventPath;
+ return *m_eventPath;
- WillBeHeapVector<RefPtrWillBeMember<Node>> nodes;
- nodes.reserveInitialCapacity(path.size());
+ LocalDOMWindow* window = path.hasWindowEventContext() ? path.windowEventContext().window() : nullptr;
hayato 2015/01/15 08:27:39 I've taken a look at Event::path(). I think Event:
kojii 2015/01/16 08:37:23 Reverted. I thought |LocalDOMWindow::dispatchLoadE
+ m_eventPath = adoptPtrWillBeNoop(new WillBeHeapVector<RefPtrWillBeRawPtr<EventTarget>>());
+ m_eventPath->reserveCapacity(path.size() + window ? 1 : 0);
for (size_t i = 0; i < path.size(); ++i) {
Node& rootNode = path[i].treeScopeEventContext().rootNode();
if (rootNode.isShadowRoot() && toShadowRoot(rootNode).type() == ShadowRoot::AuthorShadowRoot)
- nodes.append(path[i].node());
+ m_eventPath->append(path[i].node());
else if (path[i].treeScopeEventContext().isInclusiveAncestorOf(*this))
- nodes.append(path[i].node());
+ m_eventPath->append(path[i].node());
}
- m_eventPath = StaticNodeList::adopt(nodes);
- return m_eventPath;
+ if (window)
+ m_eventPath->append(window);
+ return *m_eventPath;
}
TouchEventContext* TreeScopeEventContext::ensureTouchEventContext()
« Source/core/events/Event.cpp ('K') | « Source/core/events/TreeScopeEventContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698