Changeset 121285 in webkit for trunk/Source/WebCore/css/CSSToStyleMap.cpp
- Timestamp:
- Jun 26, 2012, 1:23:26 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/css/CSSToStyleMap.cpp
r121164 r121285 52 52 } 53 53 54 RenderStyle* CSSToStyleMap::parentStyle() const 55 { 56 return m_resolver->parentStyle(); 57 } 58 54 59 bool CSSToStyleMap::useSVGZoomRules() const 55 60 { … … 199 204 CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(pair->first()); 200 205 CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(pair->second()); 201 firstLength = first->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);202 secondLength = second->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);206 firstLength = first->convertToLength<AnyConversion>(style(), rootElementStyle(), parentStyle(), zoomFactor); 207 secondLength = second->convertToLength<AnyConversion>(style(), rootElementStyle(), parentStyle(), zoomFactor); 203 208 } else { 204 firstLength = primitiveValue->convertToLength<AnyConversion>(style(), rootElementStyle(), zoomFactor);209 firstLength = primitiveValue->convertToLength<AnyConversion>(style(), rootElementStyle(), parentStyle(), zoomFactor); 205 210 secondLength = Length(); 206 211 } … … 229 234 Length length; 230 235 if (primitiveValue->isLength()) 231 length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), zoomFactor);236 length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoomFactor); 232 237 else if (primitiveValue->isPercentage()) 233 238 length = Length(primitiveValue->getDoubleValue(), Percent); 234 239 else if (primitiveValue->isCalculatedPercentageWithLength()) 235 length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), zoomFactor));240 length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), parentStyle(), zoomFactor)); 236 241 else if (primitiveValue->isViewportPercentageLength()) 237 242 length = primitiveValue->viewportPercentageLength(); … … 256 261 Length length; 257 262 if (primitiveValue->isLength()) 258 length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), zoomFactor);263 length = primitiveValue->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoomFactor); 259 264 else if (primitiveValue->isPercentage()) 260 265 length = Length(primitiveValue->getDoubleValue(), Percent); 261 266 else if (primitiveValue->isCalculatedPercentageWithLength()) 262 length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), zoomFactor));267 length = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), rootElementStyle(), parentStyle(), zoomFactor)); 263 268 else if (primitiveValue->isViewportPercentageLength()) 264 269 length = primitiveValue->viewportPercentageLength(); … … 583 588 box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); 584 589 else if (slices->top()->getIdent() != CSSValueAuto) 585 box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), zoom);590 box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoom); 586 591 587 592 if (slices->right()->isNumber()) … … 590 595 box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); 591 596 else if (slices->right()->getIdent() != CSSValueAuto) 592 box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), zoom);597 box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoom); 593 598 594 599 if (slices->bottom()->isNumber()) … … 597 602 box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); 598 603 else if (slices->bottom()->getIdent() != CSSValueAuto) 599 box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), zoom);604 box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoom); 600 605 601 606 if (slices->left()->isNumber()) … … 604 609 box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); 605 610 else if (slices->left()->getIdent() != CSSValueAuto) 606 box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), zoom);611 box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), parentStyle(), zoom); 607 612 608 613 return box;
Note:
See TracChangeset
for help on using the changeset viewer.