Chromium Code Reviews| Index: Source/core/events/TreeScopeEventContext.cpp |
| diff --git a/Source/core/events/TreeScopeEventContext.cpp b/Source/core/events/TreeScopeEventContext.cpp |
| index bdf4c0fbed4690d62932af0a6b500b38df85007c..08bd5849b506b5809cfa36d312999827c5c15684 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) |
| +Vector<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.windowEventContext().window(); |
|
hayato
2015/01/15 04:15:28
Could you make sure that calling path.windowEventC
kojii
2015/01/15 06:56:44
Done.
|
| + 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() |