Index: Source/core/events/EventPath.cpp |
diff --git a/Source/core/events/EventPath.cpp b/Source/core/events/EventPath.cpp |
index 4f2a8b9907db7b1cde145e130e7fda0ad897be73..7d80754c7e957c29db9462ca83b1176bfc844f19 100644 |
--- a/Source/core/events/EventPath.cpp |
+++ b/Source/core/events/EventPath.cpp |
@@ -66,10 +66,10 @@ EventTarget* EventPath::eventTargetRespectingTargetRules(Node* referenceNode) |
Node& rootNode = referenceNode->treeScope().rootNode(); |
Element* shadowHostElement = rootNode.isShadowRoot() ? toShadowRoot(rootNode).host() : 0; |
// At this time, SVG nodes are not supported in non-<use> shadow trees. |
- if (!shadowHostElement || !shadowHostElement->hasTagName(SVGNames::useTag)) |
+ if (!isSVGUseElement(shadowHostElement)) |
return referenceNode; |
- SVGUseElement* useElement = toSVGUseElement(shadowHostElement); |
- if (SVGElementInstance* instance = useElement->instanceForShadowTreeElement(referenceNode)) |
+ SVGUseElement& useElement = toSVGUseElement(*shadowHostElement); |
+ if (SVGElementInstance* instance = useElement.instanceForShadowTreeElement(referenceNode)) |
return instance; |
return referenceNode; |