Index: Source/core/svg/SVGLengthContext.cpp |
diff --git a/Source/core/svg/SVGLengthContext.cpp b/Source/core/svg/SVGLengthContext.cpp |
index c5c3a4ff1db8ab290f435f104c419be3c5c6b9cd..31b54e1b9dda22cbe1a22bf9440c3630ae7ad540 100644 |
--- a/Source/core/svg/SVGLengthContext.cpp |
+++ b/Source/core/svg/SVGLengthContext.cpp |
@@ -308,13 +308,13 @@ bool SVGLengthContext::determineViewport(FloatSize& viewportSize) const |
// Take size from nearest viewport element. |
SVGElement* viewportElement = m_context->viewportElement(); |
- if (!viewportElement || !viewportElement->isSVGSVGElement()) |
+ if (!isSVGSVGElement(viewportElement)) |
return false; |
- const SVGSVGElement* svg = toSVGSVGElement(viewportElement); |
- viewportSize = svg->currentViewBoxRect().size(); |
+ const SVGSVGElement& svg = toSVGSVGElement(*viewportElement); |
+ viewportSize = svg.currentViewBoxRect().size(); |
if (viewportSize.isEmpty()) |
- viewportSize = svg->currentViewportSize(); |
+ viewportSize = svg.currentViewportSize(); |
return true; |
} |