Index: Source/core/css/CSSCalculationValue.cpp |
diff --git a/Source/core/css/CSSCalculationValue.cpp b/Source/core/css/CSSCalculationValue.cpp |
index 44e3c339e415798bd3aa2bc38f9e39bf465d8be7..e27cba3a66db7d1722794fe52a7a0ceb7ee51532 100644 |
--- a/Source/core/css/CSSCalculationValue.cpp |
+++ b/Source/core/css/CSSCalculationValue.cpp |
@@ -178,9 +178,9 @@ double CSSCalcValue::doubleValue() const |
return clampToPermittedRange(m_expression->doubleValue()); |
} |
-double CSSCalcValue::computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const |
+double CSSCalcValue::computeLengthPx(const CSSToLengthConversionData& conversionData) const |
{ |
- return clampToPermittedRange(m_expression->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize)); |
+ return clampToPermittedRange(m_expression->computeLengthPx(conversionData)); |
} |
CSSCalcExpressionNode::~CSSCalcExpressionNode() |
@@ -223,18 +223,18 @@ public: |
return m_value->isVariableName(); |
} |
- virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const RenderStyle* style, const RenderStyle* rootStyle, double zoom) const |
+ virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const CSSToLengthConversionData& conversionData) const |
{ |
switch (m_category) { |
case CalcNumber: |
return adoptPtr(new CalcExpressionNumber(m_value->getFloatValue())); |
case CalcLength: |
- return adoptPtr(new CalcExpressionLength(Length(m_value->computeLength<float>(style, rootStyle, zoom), WebCore::Fixed))); |
+ return adoptPtr(new CalcExpressionLength(Length(m_value->computeLength<float>(conversionData), WebCore::Fixed))); |
case CalcPercent: |
case CalcPercentLength: { |
CSSPrimitiveValue* primitiveValue = m_value.get(); |
return adoptPtr(new CalcExpressionLength(primitiveValue |
- ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(style, rootStyle, zoom) |
+ ? primitiveValue->convertToLength<FixedConversion | PercentConversion>(conversionData) |
: Length(Undefined))); |
} |
// Only types that could be part of a Length expression can be converted |
@@ -255,11 +255,11 @@ public: |
return 0; |
} |
- virtual double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const |
+ virtual double computeLengthPx(const CSSToLengthConversionData& conversionData) const |
{ |
switch (m_category) { |
case CalcLength: |
- return m_value->computeLength<double>(currentStyle, rootStyle, multiplier, computingFontSize); |
+ return m_value->computeLength<double>(conversionData); |
case CalcPercent: |
case CalcNumber: |
return m_value->getDoubleValue(); |
@@ -420,12 +420,12 @@ public: |
return !doubleValue(); |
} |
- virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const RenderStyle* style, const RenderStyle* rootStyle, double zoom) const |
+ virtual PassOwnPtr<CalcExpressionNode> toCalcValue(const CSSToLengthConversionData& conversionData) const |
{ |
- OwnPtr<CalcExpressionNode> left(m_leftSide->toCalcValue(style, rootStyle, zoom)); |
+ OwnPtr<CalcExpressionNode> left(m_leftSide->toCalcValue(conversionData)); |
if (!left) |
return nullptr; |
- OwnPtr<CalcExpressionNode> right(m_rightSide->toCalcValue(style, rootStyle, zoom)); |
+ OwnPtr<CalcExpressionNode> right(m_rightSide->toCalcValue(conversionData)); |
if (!right) |
return nullptr; |
return adoptPtr(new CalcExpressionBinaryOperation(left.release(), right.release(), m_operator)); |
@@ -436,10 +436,10 @@ public: |
return evaluate(m_leftSide->doubleValue(), m_rightSide->doubleValue()); |
} |
- virtual double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const |
+ virtual double computeLengthPx(const CSSToLengthConversionData& conversionData) const |
{ |
- const double leftValue = m_leftSide->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize); |
- const double rightValue = m_rightSide->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize); |
+ const double leftValue = m_leftSide->computeLengthPx(conversionData); |
+ const double rightValue = m_rightSide->computeLengthPx(conversionData); |
return evaluate(leftValue, rightValue); |
} |