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

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

Issue 312423002: Don't expose the user agent shadow tree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests before landing Created 6 years, 6 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 | « Source/core/events/Event.h ('k') | Source/core/svg/SVGUseElement.cpp » ('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 e0a95408c02806e4cb6b5fb50cf09442f6f68f51..aa1ea8381d8cef1748e936c3656055763cf679ea 100644
--- a/Source/core/events/Event.cpp
+++ b/Source/core/events/Event.cpp
@@ -26,6 +26,7 @@
#include "core/dom/StaticNodeList.h"
#include "core/events/EventTarget.h"
#include "core/frame/UseCounter.h"
+#include "core/svg/SVGElement.h"
#include "wtf/CurrentTime.h"
namespace WebCore {
@@ -233,6 +234,18 @@ PassRefPtrWillBeRawPtr<NodeList> Event::path() const
return StaticNodeList::createEmpty();
}
+EventTarget* Event::currentTarget() const
+{
+ if (!m_currentTarget)
+ return 0;
+ Node* node = m_currentTarget->toNode();
+ if (node && node->isSVGElement()) {
+ if (SVGElement* svgElement = toSVGElement(node)->correspondingElement())
+ return svgElement;
+ }
+ return m_currentTarget;
+}
+
void Event::trace(Visitor* visitor)
{
visitor->trace(m_target);
« no previous file with comments | « Source/core/events/Event.h ('k') | Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698