Changeset 121285 in webkit for trunk/Source/WebCore/css/CSSCalculationValue.cpp
- Timestamp:
- Jun 26, 2012, 1:23:26 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/css/CSSCalculationValue.cpp
r118900 r121285 98 98 } 99 99 100 double CSSCalcValue::computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier, bool computingFontSize) const101 { 102 return clampToPermittedRange(m_expression->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize));100 double CSSCalcValue::computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier, bool computingFontSize) const 101 { 102 return clampToPermittedRange(m_expression->computeLengthPx(currentStyle, rootStyle, parentStyle, multiplier, computingFontSize)); 103 103 } 104 104 … … 125 125 } 126 126 127 virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, double zoom) const127 virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, double zoom) const 128 128 { 129 129 switch (m_category) { … … 131 131 return adoptPtr(new CalcExpressionNumber(m_value->getFloatValue())); 132 132 case CalcLength: 133 return adoptPtr(new CalcExpressionNumber(m_value->computeLength<float>(style, rootStyle, zoom)));133 return adoptPtr(new CalcExpressionNumber(m_value->computeLength<float>(style, rootStyle, parentStyle, zoom))); 134 134 case CalcPercent: 135 135 case CalcPercentLength: 136 return adoptPtr(new CalcExpressionLength(StyleResolver::convertToFloatLength(m_value.get(), style, rootStyle, zoom)));136 return adoptPtr(new CalcExpressionLength(StyleResolver::convertToFloatLength(m_value.get(), style, rootStyle, parentStyle, zoom))); 137 137 // Only types that could be part of a Length expression can be converted 138 138 // to a CalcExpressionNode. CalcPercentNumber makes no sense as a Length. … … 160 160 } 161 161 162 virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier, bool computingFontSize) const162 virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier, bool computingFontSize) const 163 163 { 164 164 switch (m_category) { 165 165 case CalcLength: 166 return m_value->computeLength<double>(currentStyle, rootStyle, multiplier, computingFontSize);166 return m_value->computeLength<double>(currentStyle, rootStyle, parentStyle, multiplier, computingFontSize); 167 167 case CalcPercent: 168 168 case CalcNumber: … … 238 238 } 239 239 240 virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, double zoom) const241 { 242 OwnPtr<CalcExpressionNode> left(m_leftSide->toCalcValue(style, rootStyle, zoom));240 virtual PassOwnPtr<CalcExpressionNode> toCalcValue(RenderStyle* style, RenderStyle* rootStyle, RenderStyle* parentStyle, double zoom) const 241 { 242 OwnPtr<CalcExpressionNode> left(m_leftSide->toCalcValue(style, rootStyle, parentStyle, zoom)); 243 243 if (!left) 244 244 return nullptr; 245 OwnPtr<CalcExpressionNode> right(m_rightSide->toCalcValue(style, rootStyle, zoom));245 OwnPtr<CalcExpressionNode> right(m_rightSide->toCalcValue(style, rootStyle, parentStyle, zoom)); 246 246 if (!right) 247 247 return nullptr; … … 254 254 } 255 255 256 virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, double multiplier, bool computingFontSize) const257 { 258 const double leftValue = m_leftSide->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize);259 const double rightValue = m_rightSide->computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize);256 virtual double computeLengthPx(RenderStyle* currentStyle, RenderStyle* rootStyle, RenderStyle* parentStyle, double multiplier, bool computingFontSize) const 257 { 258 const double leftValue = m_leftSide->computeLengthPx(currentStyle, rootStyle, parentStyle, multiplier, computingFontSize); 259 const double rightValue = m_rightSide->computeLengthPx(currentStyle, rootStyle, parentStyle, multiplier, computingFontSize); 260 260 return evaluate(leftValue, rightValue); 261 261 }
Note:
See TracChangeset
for help on using the changeset viewer.