| Index: Source/core/dom/Event.cpp
|
| diff --git a/Source/core/dom/Event.cpp b/Source/core/dom/Event.cpp
|
| index 637ca94f119a5c4126a3cadc82fddd7a2d856675..8a548c53423ad892c8b13cc356dc49b124f9df8d 100644
|
| --- a/Source/core/dom/Event.cpp
|
| +++ b/Source/core/dom/Event.cpp
|
| @@ -26,6 +26,7 @@
|
| #include "core/dom/EventDispatcher.h"
|
| #include "core/dom/EventNames.h"
|
| #include "core/dom/EventTarget.h"
|
| +#include "core/dom/StaticNodeList.h"
|
| #include "core/dom/UserGestureIndicator.h"
|
| #include "core/dom/WebCoreMemoryInstrumentation.h"
|
| #include <wtf/CurrentTime.h>
|
| @@ -201,4 +202,19 @@ void Event::setUnderlyingEvent(PassRefPtr<Event> ue)
|
| m_underlyingEvent = ue;
|
| }
|
|
|
| +PassRefPtr<NodeList> Event::path() const
|
| +{
|
| + if (!m_currentTarget || !m_currentTarget->toNode())
|
| + return StaticNodeList::createEmpty();
|
| + Node* currentTarget = m_currentTarget->toNode();
|
| + Vector<RefPtr<Node> > nodes;
|
| + size_t eventPathSize = m_eventPath.size();
|
| + for (size_t i = 0; i < eventPathSize; ++i) {
|
| + Node* node = m_eventPath[i]->node();
|
| + if (currentTarget->canReach(node))
|
| + nodes.append(node);
|
| + }
|
| + return StaticNodeList::adopt(nodes);
|
| +}
|
| +
|
| } // namespace WebCore
|
|
|