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

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

Issue 2742293006: Support event handling in SVG's use-element shadow trees (Closed)
Patch Set: needs rebaseline Created 3 years, 9 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 8799cc033b1c1d8d2904765ff0619ecea3bf3158..7fb74576dd084320d1ba50977d5f71ce7ee0020e 100644
--- a/third_party/WebKit/Source/core/events/Event.cpp
+++ b/third_party/WebKit/Source/core/events/Event.cpp
@@ -328,6 +328,17 @@ EventDispatchMediator* Event::createMediator() {
return EventDispatchMediator::create(this);
}
+EventTarget* Event::currentTarget() const {
+ if (!m_currentTarget)
+ return nullptr;
+ Node* node = m_currentTarget->toNode();
+ if (node && node->isSVGElement()) {
+ if (SVGElement* svgElement = toSVGElement(node)->correspondingElement())
+ return svgElement;
+ }
+ return m_currentTarget.get();
+}
+
double Event::timeStamp(ScriptState* scriptState) const {
double timeStamp = 0;
if (scriptState && scriptState->domWindow()) {
« no previous file with comments | « third_party/WebKit/Source/core/events/Event.h ('k') | third_party/WebKit/Source/core/events/EventListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698