| Index: Source/core/css/CSSBasicShapes.cpp
|
| diff --git a/Source/core/css/CSSBasicShapes.cpp b/Source/core/css/CSSBasicShapes.cpp
|
| index 8af835b6039e250a0593a722076f1d80a18c641a..170755f704c6c841bd4c89c2208df17f543b1298 100644
|
| --- a/Source/core/css/CSSBasicShapes.cpp
|
| +++ b/Source/core/css/CSSBasicShapes.cpp
|
| @@ -69,23 +69,23 @@ static String buildCircleString(const String& radius, const String& centerX, con
|
|
|
| static String serializePositionOffset(const Pair& offset, const Pair& other)
|
| {
|
| - if ((toCSSPrimitiveValue(*offset.first()).getValueID() == CSSValueLeft && toCSSPrimitiveValue(*other.first()).getValueID() == CSSValueTop)
|
| - || (toCSSPrimitiveValue(*offset.first()).getValueID() == CSSValueTop && toCSSPrimitiveValue(*other.first()).getValueID() == CSSValueLeft))
|
| - return offset.second()->cssText();
|
| + if ((offset.first().getValueID() == CSSValueLeft && other.first().getValueID() == CSSValueTop)
|
| + || (offset.first().getValueID() == CSSValueTop && other.first().getValueID() == CSSValueLeft))
|
| + return offset.second().cssText();
|
| return offset.cssText();
|
| }
|
|
|
| -static CSSPrimitiveValue buildSerializablePositionOffset(NullableCSSValue offset, CSSValueID defaultSide)
|
| +static CSSPrimitiveValue buildSerializablePositionOffset(const NullableCSSValue& offset, CSSValueID defaultSide)
|
| {
|
| CSSValueID side = defaultSide;
|
| NullableCSSValue amount;
|
|
|
| if (!offset) {
|
| side = CSSValueCenter;
|
| - } else if (toCSSPrimitiveValue(*offset).isValueID()) {
|
| - side = toCSSPrimitiveValue(*offset).getValueID();
|
| - } else if (Pair* pair = toCSSPrimitiveValue(*offset).getPairValue()) {
|
| - side = toCSSPrimitiveValue(*pair->first()).getValueID();
|
| + } else if (toCSSPrimitiveValue(offset).isValueID()) {
|
| + side = toCSSPrimitiveValue(offset).getValueID();
|
| + } else if (Pair* pair = toCSSPrimitiveValue(offset).getPairValue()) {
|
| + side = pair->first().getValueID();
|
| amount = pair->second();
|
| } else {
|
| amount = offset;
|
| @@ -95,10 +95,10 @@ static CSSPrimitiveValue buildSerializablePositionOffset(NullableCSSValue offset
|
| side = defaultSide;
|
| amount = cssValuePool().createValue(50, CSSPrimitiveValue::CSS_PERCENTAGE);
|
| } else if ((side == CSSValueRight || side == CSSValueBottom)
|
| - && toCSSPrimitiveValue(*amount).isPercentage()) {
|
| + && toCSSPrimitiveValue(amount).isPercentage()) {
|
| side = defaultSide;
|
| - amount = cssValuePool().createValue(100 - toCSSPrimitiveValue(*amount).getFloatValue(), CSSPrimitiveValue::CSS_PERCENTAGE);
|
| - } else if (toCSSPrimitiveValue(*amount).isLength() && !toCSSPrimitiveValue(*amount).getFloatValue()) {
|
| + amount = cssValuePool().createValue(100 - toCSSPrimitiveValue(amount).getFloatValue(), CSSPrimitiveValue::CSS_PERCENTAGE);
|
| + } else if (toCSSPrimitiveValue(amount).isLength() && !toCSSPrimitiveValue(amount).getFloatValue()) {
|
| if (side == CSSValueRight || side == CSSValueBottom)
|
| amount = cssValuePool().createValue(100, CSSPrimitiveValue::CSS_PERCENTAGE);
|
| else
|
| @@ -106,7 +106,7 @@ static CSSPrimitiveValue buildSerializablePositionOffset(NullableCSSValue offset
|
| side = defaultSide;
|
| }
|
|
|
| - return cssValuePool().createValue(Pair::create(cssValuePool().createValue(side), toCSSPrimitiveValue(*amount), Pair::KeepIdenticalValues));
|
| + return cssValuePool().createValue(Pair::create(cssValuePool().createValue(side), toCSSPrimitiveValue(amount), Pair::KeepIdenticalValues));
|
| }
|
|
|
| String CSSBasicShapeCircle::cssText() const
|
| @@ -115,7 +115,7 @@ String CSSBasicShapeCircle::cssText() const
|
| CSSPrimitiveValue normalizedCY = buildSerializablePositionOffset(m_centerY, CSSValueTop);
|
|
|
| String radius;
|
| - if (m_radius && toCSSPrimitiveValue(*m_radius).getValueID() != CSSValueClosestSide)
|
| + if (m_radius && toCSSPrimitiveValue(m_radius).getValueID() != CSSValueClosestSide)
|
| radius = m_radius->cssText();
|
|
|
| return buildCircleString(radius,
|
| @@ -187,11 +187,11 @@ String CSSBasicShapeEllipse::cssText() const
|
| String radiusX;
|
| String radiusY;
|
| if (m_radiusX) {
|
| - bool shouldSerializeRadiusXValue = toCSSPrimitiveValue(*m_radiusX).getValueID() != CSSValueClosestSide;
|
| + bool shouldSerializeRadiusXValue = toCSSPrimitiveValue(m_radiusX).getValueID() != CSSValueClosestSide;
|
| bool shouldSerializeRadiusYValue = false;
|
|
|
| if (m_radiusY) {
|
| - shouldSerializeRadiusYValue = toCSSPrimitiveValue(*m_radiusY).getValueID() != CSSValueClosestSide;
|
| + shouldSerializeRadiusYValue = toCSSPrimitiveValue(m_radiusY).getValueID() != CSSValueClosestSide;
|
| if (shouldSerializeRadiusYValue)
|
| radiusY = m_radiusY->cssText();
|
| }
|
| @@ -378,15 +378,14 @@ static String buildInsetString(const String& top, const String& right, const Str
|
| return result.toString();
|
| }
|
|
|
| -static inline void updateCornerRadiusWidthAndHeight(NullableCSSValue corner, String& width, String& height)
|
| +static inline void updateCornerRadiusWidthAndHeight(const NullableCSSValue& corner, String& width, String& height)
|
| {
|
| if (!corner)
|
| return;
|
|
|
| - Pair* radius = toCSSPrimitiveValue(*corner).getPairValue();
|
| - width = radius->first() ? radius->first()->cssText() : String("0");
|
| - if (radius->second())
|
| - height = radius->second()->cssText();
|
| + Pair* radius = toCSSPrimitiveValue(corner).getPairValue();
|
| + width = radius->first().cssText();
|
| + height = radius->second().cssText();
|
| }
|
|
|
| String CSSBasicShapeInset::cssText() const
|
|
|