Index: Source/core/css/CSSCalculationValue.cpp |
diff --git a/Source/core/css/CSSCalculationValue.cpp b/Source/core/css/CSSCalculationValue.cpp |
index 98e5ebd13fb9e276f1ae23d2040151b1708f7d6c..58eafddc048195b0d537bd18f33c5140b5b7ea12 100644 |
--- a/Source/core/css/CSSCalculationValue.cpp |
+++ b/Source/core/css/CSSCalculationValue.cpp |
@@ -187,7 +187,7 @@ class CSSCalcPrimitiveValue final : public CSSCalcExpressionNode { |
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CSSCalcPrimitiveValue); |
public: |
- static PassRefPtrWillBeRawPtr<CSSCalcPrimitiveValue> create(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value, bool isInteger) |
+ static PassRefPtrWillBeRawPtr<CSSCalcPrimitiveValue> create(CSSPrimitiveValue value, bool isInteger) |
{ |
return adoptRefWillBeNoop(new CSSCalcPrimitiveValue(value, isInteger)); |
} |
@@ -196,28 +196,28 @@ public: |
{ |
if (std::isnan(value) || std::isinf(value)) |
return nullptr; |
- return adoptRefWillBeNoop(new CSSCalcPrimitiveValue(CSSPrimitiveValue::create(value, type).get(), isInteger)); |
+ return adoptRefWillBeNoop(new CSSCalcPrimitiveValue(CSSPrimitiveValue::create(value, type), isInteger)); |
} |
virtual bool isZero() const override |
{ |
- return !m_value->getDoubleValue(); |
+ return !toCSSPrimitiveValue(m_value).getDoubleValue(); |
} |
virtual String customCSSText() const override |
{ |
- return m_value->cssText(); |
+ return m_value.cssText(); |
} |
virtual void accumulatePixelsAndPercent(const CSSToLengthConversionData& conversionData, PixelsAndPercent& value, float multiplier) const override |
{ |
switch (m_category) { |
case CalcLength: |
- value.pixels += m_value->computeLength<float>(conversionData) * multiplier; |
+ value.pixels += toCSSPrimitiveValue(m_value).computeLength<float>(conversionData) * multiplier; |
break; |
case CalcPercent: |
- ASSERT(m_value->isPercentage()); |
- value.percent += m_value->getDoubleValue() * multiplier; |
+ ASSERT(toCSSPrimitiveValue(m_value).isPercentage()); |
+ value.percent += toCSSPrimitiveValue(m_value).getDoubleValue() * multiplier; |
break; |
default: |
ASSERT_NOT_REACHED(); |
@@ -227,7 +227,7 @@ public: |
virtual double doubleValue() const override |
{ |
if (hasDoubleValue(primitiveType())) |
- return m_value->getDoubleValue(); |
+ return toCSSPrimitiveValue(m_value).getDoubleValue(); |
ASSERT_NOT_REACHED(); |
return 0; |
} |
@@ -236,10 +236,10 @@ public: |
{ |
switch (m_category) { |
case CalcLength: |
- return m_value->computeLength<double>(conversionData); |
+ return toCSSPrimitiveValue(m_value).computeLength<double>(conversionData); |
case CalcNumber: |
case CalcPercent: |
- return m_value->getDoubleValue(); |
+ return toCSSPrimitiveValue(m_value).getDoubleValue(); |
case CalcAngle: |
case CalcFrequency: |
case CalcPercentLength: |
@@ -256,7 +256,7 @@ public: |
virtual void accumulateLengthArray(CSSLengthArray& lengthArray, CSSLengthTypeArray& lengthTypeArray, double multiplier) const override |
{ |
ASSERT(category() != CalcNumber); |
- m_value->accumulateLengthArray(lengthArray, lengthTypeArray, multiplier); |
+ toCSSPrimitiveValue(m_value).accumulateLengthArray(lengthArray, lengthTypeArray, multiplier); |
} |
virtual bool equals(const CSSCalcExpressionNode& other) const override |
@@ -264,13 +264,13 @@ public: |
if (type() != other.type()) |
return false; |
- return compareCSSValuePtr(m_value, static_cast<const CSSCalcPrimitiveValue&>(other).m_value); |
+ return m_value.equals(static_cast<const CSSCalcPrimitiveValue&>(other).m_value); |
} |
virtual Type type() const override { return CssCalcPrimitiveValue; } |
virtual CSSPrimitiveValue::UnitType primitiveType() const override |
{ |
- return m_value->primitiveType(); |
+ return toCSSPrimitiveValue(m_value).primitiveType(); |
} |
@@ -281,13 +281,13 @@ public: |
} |
private: |
- CSSCalcPrimitiveValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value, bool isInteger) |
- : CSSCalcExpressionNode(unitCategory(value->primitiveType()), isInteger) |
+ CSSCalcPrimitiveValue(CSSPrimitiveValue value, bool isInteger) |
+ : CSSCalcExpressionNode(unitCategory(value.primitiveType()), isInteger) |
, m_value(value) |
{ |
} |
- RefPtrWillBeMember<CSSPrimitiveValue> m_value; |
+ CSSValue m_value; |
}; |
static const CalculationCategory addSubtractResult[CalcOther][CalcOther] = { |
@@ -730,7 +730,7 @@ private: |
} |
}; |
-PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> CSSCalcValue::createExpressionNode(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value, bool isInteger) |
+PassRefPtrWillBeRawPtr<CSSCalcExpressionNode> CSSCalcValue::createExpressionNode(CSSPrimitiveValue value, bool isInteger) |
{ |
return CSSCalcPrimitiveValue::create(value, isInteger); |
} |