Index: Source/core/layout/svg/LayoutSVGEllipse.cpp |
diff --git a/Source/core/layout/svg/LayoutSVGEllipse.cpp b/Source/core/layout/svg/LayoutSVGEllipse.cpp |
index b7ecc369fdcf3b46f41217f4ebcdd35fc220de0c..3e07df274112ef785e733ed8a7295dcea36db922 100644 |
--- a/Source/core/layout/svg/LayoutSVGEllipse.cpp |
+++ b/Source/core/layout/svg/LayoutSVGEllipse.cpp |
@@ -82,21 +82,19 @@ void LayoutSVGEllipse::updateShapeFromElement() |
void LayoutSVGEllipse::calculateRadiiAndCenter() |
{ |
ASSERT(element()); |
- if (isSVGCircleElement(*element())) { |
- SVGCircleElement& circle = toSVGCircleElement(*element()); |
+ SVGLengthContext lengthContext(element()); |
+ m_center = FloatPoint( |
+ lengthContext.valueForLength(style()->svgStyle().cx(), styleRef(), SVGLengthMode::Width), |
+ lengthContext.valueForLength(style()->svgStyle().cy(), styleRef(), SVGLengthMode::Height)); |
- SVGLengthContext lengthContext(&circle); |
- float radius = circle.r()->currentValue()->value(lengthContext); |
+ if (isSVGCircleElement(*element())) { |
+ float radius = lengthContext.valueForLength(style()->svgStyle().r(), styleRef(), SVGLengthMode::Other); |
m_radii = FloatSize(radius, radius); |
- m_center = FloatPoint(circle.cx()->currentValue()->value(lengthContext), circle.cy()->currentValue()->value(lengthContext)); |
- return; |
+ } else { |
+ m_radii = FloatSize( |
+ lengthContext.valueForLength(style()->svgStyle().rx(), styleRef(), SVGLengthMode::Width), |
+ lengthContext.valueForLength(style()->svgStyle().ry(), styleRef(), SVGLengthMode::Height)); |
} |
- |
- SVGEllipseElement& ellipse = toSVGEllipseElement(*element()); |
- |
- SVGLengthContext lengthContext(&ellipse); |
- m_radii = FloatSize(ellipse.rx()->currentValue()->value(lengthContext), ellipse.ry()->currentValue()->value(lengthContext)); |
- m_center = FloatPoint(ellipse.cx()->currentValue()->value(lengthContext), ellipse.cy()->currentValue()->value(lengthContext)); |
} |
bool LayoutSVGEllipse::shapeDependentStrokeContains(const FloatPoint& point) |