Index: Source/core/css/CSSBasicShapes.cpp |
diff --git a/Source/core/css/CSSBasicShapes.cpp b/Source/core/css/CSSBasicShapes.cpp |
index e0c9340215be90f7b8f10cb263f58a8f10c4f1c3..2f326c9e0f24e0be482e6b4af9a226bd6937c8bc 100644 |
--- a/Source/core/css/CSSBasicShapes.cpp |
+++ b/Source/core/css/CSSBasicShapes.cpp |
@@ -114,7 +114,11 @@ String CSSBasicShapeCircle::cssText() const |
RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCX = buildSerializablePositionOffset(m_centerX, CSSValueLeft); |
RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCY = buildSerializablePositionOffset(m_centerY, CSSValueTop); |
- return buildCircleString(m_radius ? m_radius->cssText() : String(), |
+ String radius; |
+ if (m_radius && m_radius->getValueID() != CSSValueClosestSide) |
eseidel
2014/05/28 22:08:10
This smells odd. Why is CSSValueClosestSide speci
|
+ radius = m_radius->cssText(); |
+ |
+ return buildCircleString(radius, |
serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->getPairValue()), |
serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()), |
m_referenceBox ? m_referenceBox->cssText() : String()); |
@@ -180,8 +184,22 @@ String CSSBasicShapeEllipse::cssText() const |
RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCX = buildSerializablePositionOffset(m_centerX, CSSValueLeft); |
RefPtrWillBeRawPtr<CSSPrimitiveValue> normalizedCY = buildSerializablePositionOffset(m_centerY, CSSValueTop); |
- return buildEllipseString(m_radiusX ? m_radiusX->cssText() : String(), |
- m_radiusY ? m_radiusY->cssText() : String(), |
+ String radiusX; |
+ String radiusY; |
+ if (m_radiusX) { |
+ bool shouldSerializeRadiusXValue = m_radiusX->getValueID() != CSSValueClosestSide; |
eseidel
2014/05/28 22:08:10
Here again. Magic constants = confused reader.
|
+ bool shouldSerializeRadiusYValue = false; |
+ |
+ if (m_radiusY) { |
+ shouldSerializeRadiusYValue = m_radiusY->getValueID() != CSSValueClosestSide; |
+ if (shouldSerializeRadiusYValue) |
+ radiusY = m_radiusY->cssText(); |
+ } |
+ if (shouldSerializeRadiusXValue || (!shouldSerializeRadiusXValue && shouldSerializeRadiusYValue)) |
+ radiusX = m_radiusX->cssText(); |
+ } |
+ |
+ return buildEllipseString(radiusX, radiusY, |
serializePositionOffset(*normalizedCX->getPairValue(), *normalizedCY->getPairValue()), |
serializePositionOffset(*normalizedCY->getPairValue(), *normalizedCX->getPairValue()), |
m_referenceBox ? m_referenceBox->cssText() : String()); |