Index: Source/core/rendering/svg/RenderSVGGradientStop.cpp |
diff --git a/Source/core/rendering/svg/RenderSVGGradientStop.cpp b/Source/core/rendering/svg/RenderSVGGradientStop.cpp |
index ca5f315a7bc46f660b03b9a0e36d6a2a6cdd1258..2d66b5ddab4e014a12e87e8c337875dd67c1e98e 100644 |
--- a/Source/core/rendering/svg/RenderSVGGradientStop.cpp |
+++ b/Source/core/rendering/svg/RenderSVGGradientStop.cpp |
@@ -67,9 +67,8 @@ void RenderSVGGradientStop::layout() |
SVGGradientElement* RenderSVGGradientStop::gradientElement() const |
{ |
ContainerNode* parentNode = node()->parentNode(); |
- if (parentNode->hasTagName(linearGradientTag) || parentNode->hasTagName(radialGradientTag)) |
- return toSVGGradientElement(parentNode); |
- return 0; |
+ ASSERT(parentNode); |
+ return isSVGGradientElement(*parentNode) ? toSVGGradientElement(parentNode) : 0; |
} |
} |