Changeset 67568 in webkit
- Timestamp:
- Sep 15, 2010 2:23:52 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r67563 r67568 1 2010-09-14 Erik Arvidsson <arv@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 getComputedStyle() returns different values for different zoom levels 6 https://bugs.webkit.org/show_bug.cgi?id=32230 7 8 * fast/css/getComputedStyle/computed-style-with-zoom-expected.txt: Added. 9 * fast/css/getComputedStyle/computed-style-with-zoom.html: Added. 10 * fast/css/getComputedStyle/script-tests/computed-style-with-zoom.js: Added. 11 (testProperty): 12 (testPropertyValue): 13 1 14 2010-09-15 Chris Fleizach <cfleizach@apple.com> 2 15 -
trunk/WebCore/ChangeLog
r67567 r67568 1 2010-09-14 Erik Arvidsson <arv@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 getComputedStyle() returns different values for different zoom levels 6 https://bugs.webkit.org/show_bug.cgi?id=32230 7 8 Test: fast/css/getComputedStyle/computed-style-with-zoom.html 9 10 * css/CSSComputedStyleDeclaration.cpp: 11 (WebCore::zoomAdjustedPixelValue): 12 (WebCore::zoomAdjustedNumberValue): 13 (WebCore::valueForReflection): 14 (WebCore::getPositionOffsetValue): 15 (WebCore::getBorderRadiusCornerValue): 16 (WebCore::computedTransform): 17 (WebCore::CSSComputedStyleDeclaration::getFontSizeCSSValuePreferringKeyword): 18 (WebCore::CSSComputedStyleDeclaration::valueForShadow): 19 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 20 * css/CSSComputedStyleDeclaration.h: 21 * css/SVGCSSComputedStyleDeclaration.cpp: 22 (WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue): 23 * rendering/RenderObject.h: 24 (WebCore::adjustForAbsoluteZoom): 25 * rendering/style/RenderStyle.h: 26 (WebCore::adjustForAbsoluteZoom): 27 1 28 2010-09-14 Martin Robinson <mrobinson@igalia.com> 2 29 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r67102 r67568 328 328 } 329 329 330 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection) 330 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(int value, const RenderStyle* style) 331 { 332 return CSSPrimitiveValue::create(adjustForAbsoluteZoom(value, style), CSSPrimitiveValue::CSS_PX); 333 } 334 335 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value, const RenderStyle* style) 336 { 337 return CSSPrimitiveValue::create(value / style->effectiveZoom(), CSSPrimitiveValue::CSS_NUMBER); 338 } 339 340 static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection, const RenderStyle* style) 331 341 { 332 342 if (!reflection) … … 337 347 offset = CSSPrimitiveValue::create(reflection->offset().percent(), CSSPrimitiveValue::CSS_PERCENTAGE); 338 348 else 339 offset = CSSPrimitiveValue::create(reflection->offset().value(), CSSPrimitiveValue::CSS_PX);349 offset = zoomAdjustedPixelValue(reflection->offset().value(), style); 340 350 341 351 return CSSReflectValue::create(reflection->direction(), offset.release(), valueForNinePieceImage(reflection->mask())); … … 365 375 } 366 376 367 if (style->position() == AbsolutePosition || style->position() == FixedPosition) 377 if (style->position() == AbsolutePosition || style->position() == FixedPosition) { 378 if (l.type() == WebCore::Fixed) 379 return zoomAdjustedPixelValue(l.value(), style); 368 380 return CSSPrimitiveValue::create(l); 381 } 369 382 370 383 if (style->position() == RelativePosition) … … 385 398 } 386 399 387 static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius )400 static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius, const RenderStyle* style) 388 401 { 389 402 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); … … 391 404 if (radius.width().type() == Percent) 392 405 return CSSPrimitiveValue::create(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE); 393 return CSSPrimitiveValue::create(radius.width().value(), CSSPrimitiveValue::CSS_PX);406 return zoomAdjustedPixelValue(radius.width().value(), style); 394 407 } 395 408 if (radius.width().type() == Percent) 396 409 list->append(CSSPrimitiveValue::create(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); 397 410 else 398 list->append( CSSPrimitiveValue::create(radius.width().value(), CSSPrimitiveValue::CSS_PX));411 list->append(zoomAdjustedPixelValue(radius.width().value(), style)); 399 412 if (radius.height().type() == Percent) 400 413 list->append(CSSPrimitiveValue::create(radius.height().percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); 401 414 else 402 list->append( CSSPrimitiveValue::create(radius.height().value(), CSSPrimitiveValue::CSS_PX));415 list->append(zoomAdjustedPixelValue(radius.height().value(), style)); 403 416 return list.release(); 404 417 } … … 439 452 transformVal->append(CSSPrimitiveValue::create(transform.c(), CSSPrimitiveValue::CSS_NUMBER)); 440 453 transformVal->append(CSSPrimitiveValue::create(transform.d(), CSSPrimitiveValue::CSS_NUMBER)); 441 transformVal->append( CSSPrimitiveValue::create(transform.e(), CSSPrimitiveValue::CSS_NUMBER));442 transformVal->append( CSSPrimitiveValue::create(transform.f(), CSSPrimitiveValue::CSS_NUMBER));454 transformVal->append(zoomAdjustedNumberValue(transform.e(), style)); 455 transformVal->append(zoomAdjustedNumberValue(transform.f(), style)); 443 456 } else { 444 457 transformVal = WebKitCSSTransformValue::create(WebKitCSSTransformValue::Matrix3DTransformOperation); … … 459 472 transformVal->append(CSSPrimitiveValue::create(transform.m34(), CSSPrimitiveValue::CSS_NUMBER)); 460 473 461 transformVal->append( CSSPrimitiveValue::create(transform.m41(), CSSPrimitiveValue::CSS_NUMBER));462 transformVal->append( CSSPrimitiveValue::create(transform.m42(), CSSPrimitiveValue::CSS_NUMBER));463 transformVal->append( CSSPrimitiveValue::create(transform.m43(), CSSPrimitiveValue::CSS_NUMBER));474 transformVal->append(zoomAdjustedNumberValue(transform.m41(), style)); 475 transformVal->append(zoomAdjustedNumberValue(transform.m42(), style)); 476 transformVal->append(zoomAdjustedNumberValue(transform.m43(), style)); 464 477 transformVal->append(CSSPrimitiveValue::create(transform.m44(), CSSPrimitiveValue::CSS_NUMBER)); 465 478 } … … 584 597 return CSSPrimitiveValue::createIdentifier(cssIdentifierForFontSizeKeyword(keywordSize)); 585 598 586 return CSSPrimitiveValue::create(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX); 599 600 return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(), style.get()); 587 601 } 588 602 … … 599 613 } 600 614 601 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const ShadowData* shadow, int id ) const615 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const ShadowData* shadow, int id, RenderStyle* style) const 602 616 { 603 617 if (!shadow) … … 608 622 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 609 623 for (const ShadowData* s = shadow; s; s = s->next()) { 610 RefPtr<CSSPrimitiveValue> x = CSSPrimitiveValue::create(s->x(), CSSPrimitiveValue::CSS_PX);611 RefPtr<CSSPrimitiveValue> y = CSSPrimitiveValue::create(s->y(), CSSPrimitiveValue::CSS_PX);612 RefPtr<CSSPrimitiveValue> blur = CSSPrimitiveValue::create(s->blur(), CSSPrimitiveValue::CSS_PX);613 RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread(), CSSPrimitiveValue::CSS_PX);624 RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(s->x(), style); 625 RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(s->y(), style); 626 RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(s->blur(), style); 627 RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : zoomAdjustedPixelValue(s->spread(), style); 614 628 RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow || s->style() == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset); 615 629 RefPtr<CSSPrimitiveValue> color = CSSPrimitiveValue::createColor(s->color().rgb()); … … 775 789 case CSSPropertyBorderSpacing: { 776 790 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 777 list->append( CSSPrimitiveValue::create(style->horizontalBorderSpacing(), CSSPrimitiveValue::CSS_PX));778 list->append( CSSPrimitiveValue::create(style->verticalBorderSpacing(), CSSPrimitiveValue::CSS_PX));791 list->append(zoomAdjustedPixelValue(style->horizontalBorderSpacing(), style.get())); 792 list->append(zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.get())); 779 793 return list.release(); 780 794 } 781 795 case CSSPropertyWebkitBorderHorizontalSpacing: 782 return CSSPrimitiveValue::create(style->horizontalBorderSpacing(), CSSPrimitiveValue::CSS_PX);796 return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), style.get()); 783 797 case CSSPropertyWebkitBorderVerticalSpacing: 784 return CSSPrimitiveValue::create(style->verticalBorderSpacing(), CSSPrimitiveValue::CSS_PX);798 return zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.get()); 785 799 case CSSPropertyBorderTopColor: 786 800 return m_allowVisitedStyle ? CSSPrimitiveValue::createColor(style->visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidColor(style.get(), style->borderTopColor()); … … 800 814 return CSSPrimitiveValue::create(style->borderLeftStyle()); 801 815 case CSSPropertyBorderTopWidth: 802 return CSSPrimitiveValue::create(style->borderTopWidth(), CSSPrimitiveValue::CSS_PX);816 return zoomAdjustedPixelValue(style->borderTopWidth(), style.get()); 803 817 case CSSPropertyBorderRightWidth: 804 return CSSPrimitiveValue::create(style->borderRightWidth(), CSSPrimitiveValue::CSS_PX);818 return zoomAdjustedPixelValue(style->borderRightWidth(), style.get()); 805 819 case CSSPropertyBorderBottomWidth: 806 return CSSPrimitiveValue::create(style->borderBottomWidth(), CSSPrimitiveValue::CSS_PX);820 return zoomAdjustedPixelValue(style->borderBottomWidth(), style.get()); 807 821 case CSSPropertyBorderLeftWidth: 808 return CSSPrimitiveValue::create(style->borderLeftWidth(), CSSPrimitiveValue::CSS_PX);822 return zoomAdjustedPixelValue(style->borderLeftWidth(), style.get()); 809 823 case CSSPropertyBottom: 810 824 return getPositionOffsetValue(style.get(), CSSPropertyBottom); … … 832 846 } 833 847 case CSSPropertyWebkitBoxReflect: 834 return valueForReflection(style->boxReflect() );848 return valueForReflection(style->boxReflect(), style.get()); 835 849 case CSSPropertyWebkitBoxShadow: 836 return valueForShadow(style->boxShadow(), propertyID );850 return valueForShadow(style->boxShadow(), propertyID, style.get()); 837 851 case CSSPropertyCaptionSide: 838 852 return CSSPrimitiveValue::create(style->captionSide()); … … 854 868 return CSSPrimitiveValue::create(style->columnRuleStyle()); 855 869 case CSSPropertyWebkitColumnRuleWidth: 856 return CSSPrimitiveValue::create(style->columnRuleWidth(), CSSPrimitiveValue::CSS_PX);870 return zoomAdjustedPixelValue(style->columnRuleWidth(), style.get()); 857 871 case CSSPropertyWebkitColumnSpan: 858 872 if (style->columnSpan()) … … 902 916 } 903 917 case CSSPropertyFontSize: 904 return CSSPrimitiveValue::create(style->fontDescription().computedPixelSize(), CSSPrimitiveValue::CSS_PX);918 return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(), style.get()); 905 919 case CSSPropertyFontStyle: 906 920 if (style->fontDescription().italic()) … … 936 950 case CSSPropertyHeight: 937 951 if (renderer) 938 return CSSPrimitiveValue::create(sizingBox(renderer).height(), CSSPrimitiveValue::CSS_PX);952 return zoomAdjustedPixelValue(sizingBox(renderer).height(), style.get()); 939 953 return CSSPrimitiveValue::create(style->height()); 940 954 case CSSPropertyWebkitHighlight: … … 961 975 if (!style->letterSpacing()) 962 976 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); 963 return CSSPrimitiveValue::create(style->letterSpacing(), CSSPrimitiveValue::CSS_PX);977 return zoomAdjustedPixelValue(style->letterSpacing(), style.get()); 964 978 case CSSPropertyWebkitLineClamp: 965 979 if (style->lineClamp().isNone()) … … 975 989 // On the other hand, since font-size doesn't include the zoom factor, we really can't do 976 990 // that here either. 977 return CSSPrimitiveValue::create(static_cast<int>(length.percent() * style->fontDescription().specifiedSize()) / 100, CSSPrimitiveValue::CSS_PX);978 return CSSPrimitiveValue::create(length.value(), CSSPrimitiveValue::CSS_PX);991 return zoomAdjustedPixelValue(static_cast<int>(length.percent() * style->fontDescription().specifiedSize()) / 100, style.get()); 992 return zoomAdjustedPixelValue(length.value(), style.get()); 979 993 } 980 994 case CSSPropertyListStyleImage: … … 989 1003 if (renderer && renderer->isBox()) 990 1004 // FIXME: Supposed to return the percentage if percentage was specified. 991 return CSSPrimitiveValue::create(toRenderBox(renderer)->marginTop(), CSSPrimitiveValue::CSS_PX);1005 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginTop(), style.get()); 992 1006 return CSSPrimitiveValue::create(style->marginTop()); 993 1007 case CSSPropertyMarginRight: 994 1008 if (renderer && renderer->isBox()) 995 1009 // FIXME: Supposed to return the percentage if percentage was specified. 996 return CSSPrimitiveValue::create(toRenderBox(renderer)->marginRight(), CSSPrimitiveValue::CSS_PX);1010 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginRight(), style.get()); 997 1011 return CSSPrimitiveValue::create(style->marginRight()); 998 1012 case CSSPropertyMarginBottom: 999 1013 if (renderer && renderer->isBox()) 1000 1014 // FIXME: Supposed to return the percentage if percentage was specified. 1001 return CSSPrimitiveValue::create(toRenderBox(renderer)->marginBottom(), CSSPrimitiveValue::CSS_PX);1015 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginBottom(), style.get()); 1002 1016 return CSSPrimitiveValue::create(style->marginBottom()); 1003 1017 case CSSPropertyMarginLeft: 1004 1018 if (renderer && renderer->isBox()) 1005 1019 // FIXME: Supposed to return the percentage if percentage was specified. 1006 return CSSPrimitiveValue::create(toRenderBox(renderer)->marginLeft(), CSSPrimitiveValue::CSS_PX);1020 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginLeft(), style.get()); 1007 1021 return CSSPrimitiveValue::create(style->marginLeft()); 1008 1022 case CSSPropertyWebkitMarqueeDirection: … … 1083 1097 return CSSPrimitiveValue::create(style->outlineStyle()); 1084 1098 case CSSPropertyOutlineWidth: 1085 return CSSPrimitiveValue::create(style->outlineWidth(), CSSPrimitiveValue::CSS_PX);1099 return zoomAdjustedPixelValue(style->outlineWidth(), style.get()); 1086 1100 case CSSPropertyOverflow: 1087 1101 return CSSPrimitiveValue::create(max(style->overflowX(), style->overflowY())); … … 1092 1106 case CSSPropertyPaddingTop: 1093 1107 if (renderer && renderer->isBox()) 1094 return CSSPrimitiveValue::create(toRenderBox(renderer)->paddingTop(false), CSSPrimitiveValue::CSS_PX);1108 return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingTop(false), style.get()); 1095 1109 return CSSPrimitiveValue::create(style->paddingTop()); 1096 1110 case CSSPropertyPaddingRight: 1097 1111 if (renderer && renderer->isBox()) 1098 return CSSPrimitiveValue::create(toRenderBox(renderer)->paddingRight(false), CSSPrimitiveValue::CSS_PX);1112 return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingRight(false), style.get()); 1099 1113 return CSSPrimitiveValue::create(style->paddingRight()); 1100 1114 case CSSPropertyPaddingBottom: 1101 1115 if (renderer && renderer->isBox()) 1102 return CSSPrimitiveValue::create(toRenderBox(renderer)->paddingBottom(false), CSSPrimitiveValue::CSS_PX);1116 return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingBottom(false), style.get()); 1103 1117 return CSSPrimitiveValue::create(style->paddingBottom()); 1104 1118 case CSSPropertyPaddingLeft: 1105 1119 if (renderer && renderer->isBox()) 1106 return CSSPrimitiveValue::create(toRenderBox(renderer)->paddingLeft(false), CSSPrimitiveValue::CSS_PX);1120 return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingLeft(false), style.get()); 1107 1121 return CSSPrimitiveValue::create(style->paddingLeft()); 1108 1122 case CSSPropertyPageBreakAfter: … … 1134 1148 return CSSPrimitiveValue::create(style->textIndent()); 1135 1149 case CSSPropertyTextShadow: 1136 return valueForShadow(style->textShadow(), propertyID );1150 return valueForShadow(style->textShadow(), propertyID, style.get()); 1137 1151 case CSSPropertyTextRendering: 1138 1152 return CSSPrimitiveValue::create(style->fontDescription().textRenderingMode()); … … 1150 1164 return currentColorOrValidColor(style.get(), style->textStrokeColor()); 1151 1165 case CSSPropertyWebkitTextStrokeWidth: 1152 return CSSPrimitiveValue::create(style->textStrokeWidth(), CSSPrimitiveValue::CSS_PX);1166 return zoomAdjustedPixelValue(style->textStrokeWidth(), style.get()); 1153 1167 case CSSPropertyTextTransform: 1154 1168 return CSSPrimitiveValue::create(style->textTransform()); … … 1190 1204 case CSSPropertyWidth: 1191 1205 if (renderer) 1192 return CSSPrimitiveValue::create(sizingBox(renderer).width(), CSSPrimitiveValue::CSS_PX);1206 return zoomAdjustedPixelValue(sizingBox(renderer).width(), style.get()); 1193 1207 return CSSPrimitiveValue::create(style->width()); 1194 1208 case CSSPropertyWordBreak: 1195 1209 return CSSPrimitiveValue::create(style->wordBreak()); 1196 1210 case CSSPropertyWordSpacing: 1197 return CSSPrimitiveValue::create(style->wordSpacing(), CSSPrimitiveValue::CSS_PX);1211 return zoomAdjustedPixelValue(style->wordSpacing(), style.get()); 1198 1212 case CSSPropertyWordWrap: 1199 1213 return CSSPrimitiveValue::create(style->wordWrap()); … … 1234 1248 region->m_label = styleRegion.label; 1235 1249 LengthBox offset = styleRegion.offset; 1236 region->setTop( CSSPrimitiveValue::create(offset.top().value(), CSSPrimitiveValue::CSS_PX));1237 region->setRight( CSSPrimitiveValue::create(offset.right().value(), CSSPrimitiveValue::CSS_PX));1238 region->setBottom( CSSPrimitiveValue::create(offset.bottom().value(), CSSPrimitiveValue::CSS_PX));1239 region->setLeft( CSSPrimitiveValue::create(offset.left().value(), CSSPrimitiveValue::CSS_PX));1250 region->setTop(zoomAdjustedPixelValue(offset.top().value(), style.get())); 1251 region->setRight(zoomAdjustedPixelValue(offset.right().value(), style.get())); 1252 region->setBottom(zoomAdjustedPixelValue(offset.bottom().value(), style.get())); 1253 region->setLeft(zoomAdjustedPixelValue(offset.left().value(), style.get())); 1240 1254 region->m_isRectangle = (styleRegion.type == StyleDashboardRegion::Rectangle); 1241 1255 region->m_isCircle = (styleRegion.type == StyleDashboardRegion::Circle); … … 1358 1372 if (renderer) { 1359 1373 IntRect box = sizingBox(renderer); 1360 list->append( CSSPrimitiveValue::create(style->perspectiveOriginX().calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX));1361 list->append( CSSPrimitiveValue::create(style->perspectiveOriginY().calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX));1374 list->append(zoomAdjustedPixelValue(style->perspectiveOriginX().calcMinValue(box.width()), style.get())); 1375 list->append(zoomAdjustedPixelValue(style->perspectiveOriginY().calcMinValue(box.height()), style.get())); 1362 1376 } 1363 1377 else { … … 1376 1390 return CSSPrimitiveValue::create(style->userSelect()); 1377 1391 case CSSPropertyBorderBottomLeftRadius: 1378 return getBorderRadiusCornerValue(style->borderBottomLeftRadius() );1392 return getBorderRadiusCornerValue(style->borderBottomLeftRadius(), style.get()); 1379 1393 case CSSPropertyBorderBottomRightRadius: 1380 return getBorderRadiusCornerValue(style->borderBottomRightRadius() );1394 return getBorderRadiusCornerValue(style->borderBottomRightRadius(), style.get()); 1381 1395 case CSSPropertyBorderTopLeftRadius: 1382 return getBorderRadiusCornerValue(style->borderTopLeftRadius() );1396 return getBorderRadiusCornerValue(style->borderTopLeftRadius(), style.get()); 1383 1397 case CSSPropertyBorderTopRightRadius: 1384 return getBorderRadiusCornerValue(style->borderTopRightRadius() );1398 return getBorderRadiusCornerValue(style->borderTopRightRadius(), style.get()); 1385 1399 case CSSPropertyClip: { 1386 1400 if (!style->hasClip()) 1387 1401 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); 1388 1402 RefPtr<Rect> rect = Rect::create(); 1389 rect->setTop( CSSPrimitiveValue::create(style->clip().top().value(), CSSPrimitiveValue::CSS_PX));1390 rect->setRight( CSSPrimitiveValue::create(style->clip().right().value(), CSSPrimitiveValue::CSS_PX));1391 rect->setBottom( CSSPrimitiveValue::create(style->clip().bottom().value(), CSSPrimitiveValue::CSS_PX));1392 rect->setLeft( CSSPrimitiveValue::create(style->clip().left().value(), CSSPrimitiveValue::CSS_PX));1403 rect->setTop(zoomAdjustedPixelValue(style->clip().top().value(), style.get())); 1404 rect->setRight(zoomAdjustedPixelValue(style->clip().right().value(), style.get())); 1405 rect->setBottom(zoomAdjustedPixelValue(style->clip().bottom().value(), style.get())); 1406 rect->setLeft(zoomAdjustedPixelValue(style->clip().left().value(), style.get())); 1393 1407 return CSSPrimitiveValue::create(rect.release()); 1394 1408 } … … 1399 1413 if (renderer) { 1400 1414 IntRect box = sizingBox(renderer); 1401 list->append( CSSPrimitiveValue::create(style->transformOriginX().calcMinValue(box.width()), CSSPrimitiveValue::CSS_PX));1402 list->append( CSSPrimitiveValue::create(style->transformOriginY().calcMinValue(box.height()), CSSPrimitiveValue::CSS_PX));1415 list->append(zoomAdjustedPixelValue(style->transformOriginX().calcMinValue(box.width()), style.get())); 1416 list->append(zoomAdjustedPixelValue(style->transformOriginY().calcMinValue(box.height()), style.get())); 1403 1417 if (style->transformOriginZ() != 0) 1404 list->append( CSSPrimitiveValue::create(style->transformOriginZ(), CSSPrimitiveValue::CSS_PX));1418 list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get())); 1405 1419 } else { 1406 1420 list->append(CSSPrimitiveValue::create(style->transformOriginX())); 1407 1421 list->append(CSSPrimitiveValue::create(style->transformOriginY())); 1408 1422 if (style->transformOriginZ() != 0) 1409 list->append( CSSPrimitiveValue::create(style->transformOriginZ(), CSSPrimitiveValue::CSS_PX));1423 list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get())); 1410 1424 } 1411 1425 return list.release(); -
trunk/WebCore/css/CSSComputedStyleDeclaration.h
r67102 r67568 75 75 virtual void setProperty(int propertyId, const String& value, bool important, ExceptionCode&); 76 76 77 PassRefPtr<CSSValue> valueForShadow(const ShadowData*, int ) const;77 PassRefPtr<CSSValue> valueForShadow(const ShadowData*, int, RenderStyle*) const; 78 78 PassRefPtr<CSSPrimitiveValue> currentColorOrValidColor(RenderStyle*, const Color&) const; 79 79 -
trunk/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
r64830 r67568 181 181 } 182 182 case CSSPropertyWebkitSvgShadow: 183 return valueForShadow(svgStyle->shadow(), propertyID );183 return valueForShadow(svgStyle->shadow(), propertyID, style); 184 184 case CSSPropertyVectorEffect: 185 185 return CSSPrimitiveValue::create(svgStyle->vectorEffect()); -
trunk/WebCore/rendering/RenderObject.h
r67200 r67568 990 990 inline int adjustForAbsoluteZoom(int value, RenderObject* renderer) 991 991 { 992 double zoomFactor = renderer->style()->effectiveZoom(); 993 if (zoomFactor == 1) 994 return value; 995 // Needed because computeLengthInt truncates (rather than rounds) when scaling up. 996 if (zoomFactor > 1) 997 value++; 998 999 return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(value / zoomFactor); 992 return adjustForAbsoluteZoom(value, renderer->style()); 1000 993 } 1001 994 -
trunk/WebCore/rendering/style/RenderStyle.h
r66615 r67568 1240 1240 }; 1241 1241 1242 inline int adjustForAbsoluteZoom(int value, const RenderStyle* style) 1243 { 1244 double zoomFactor = style->effectiveZoom(); 1245 if (zoomFactor == 1) 1246 return value; 1247 // Needed because computeLengthInt truncates (rather than rounds) when scaling up. 1248 if (zoomFactor > 1) 1249 value++; 1250 1251 return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(value / zoomFactor); 1252 } 1253 1242 1254 } // namespace WebCore 1243 1255
Note: See TracChangeset
for help on using the changeset viewer.