Changeset 107301 in webkit
- Timestamp:
- Feb 9, 2012, 4:05:10 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/getComputedStyle/getComputedStyle-zoom-and-background-size-expected.txt (added)
-
LayoutTests/fast/css/getComputedStyle/getComputedStyle-zoom-and-background-size.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSComputedStyleDeclaration.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r107298 r107301 1 2012-02-09 Matthew Delaney <mdelaney@apple.com> 2 3 getComputedStyle() returns different values for different zoom levels 4 https://bugs.webkit.org/show_bug.cgi?id=32230 5 6 Reviewed by Beth Dakin. 7 8 * fast/css/getComputedStyle/getComputedStyle-zoom-and-background-size-expected.txt: Added. 9 * fast/css/getComputedStyle/getComputedStyle-zoom-and-background-size.html: Added. 10 1 11 2012-02-09 Julien Chaffraix <jchaffraix@webkit.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r107299 r107301 1 2012-02-09 Matthew Delaney <mdelaney@apple.com> 2 3 getComputedStyle() returns different values for different zoom levels 4 https://bugs.webkit.org/show_bug.cgi?id=32230 5 6 Reviewed by Beth Dakin. 7 8 Test: fast/css/getComputedStyle/getComputedStyle-zoom-and-background-size.html 9 10 * css/CSSComputedStyleDeclaration.cpp: 11 (WebCore::fillSizeToCSSValue): Pass down the RenderStyle for use in adjusting 12 values to account for zoom. 13 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Adjust additional 14 properties that are affected by zoom. 15 1 16 2012-02-09 Kentaro Hara <haraken@chromium.org> 2 17 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r107289 r107301 1134 1134 } 1135 1135 1136 static PassRefPtr<CSSValue> fillSizeToCSSValue(const FillSize& fillSize, CSSValuePool* cssValuePool)1136 static PassRefPtr<CSSValue> fillSizeToCSSValue(const FillSize& fillSize, const RenderStyle* style, CSSValuePool* cssValuePool) 1137 1137 { 1138 1138 if (fillSize.type == Contain) … … 1143 1143 1144 1144 if (fillSize.size.height().isAuto()) 1145 return cssValuePool->createValue(fillSize.size.width());1145 return zoomAdjustedPixelValueForLength(fillSize.size.width(), style, cssValuePool); 1146 1146 1147 1147 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1148 list->append( cssValuePool->createValue(fillSize.size.width()));1149 list->append( cssValuePool->createValue(fillSize.size.height()));1148 list->append(zoomAdjustedPixelValueForLength(fillSize.size.width(), style, cssValuePool)); 1149 list->append(zoomAdjustedPixelValueForLength(fillSize.size.height(), style, cssValuePool)); 1150 1150 return list.release(); 1151 1151 } … … 1325 1325 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskSize ? style->maskLayers() : style->backgroundLayers(); 1326 1326 if (!layers->next()) 1327 return fillSizeToCSSValue(layers->size(), cssValuePool);1327 return fillSizeToCSSValue(layers->size(), style.get(), cssValuePool); 1328 1328 1329 1329 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 1330 1330 for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next()) 1331 list->append(fillSizeToCSSValue(currLayer->size(), cssValuePool));1331 list->append(fillSizeToCSSValue(currLayer->size(), style.get(), cssValuePool)); 1332 1332 1333 1333 return list.release(); … … 1395 1395 if (!layers->next()) { 1396 1396 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 1397 list->append( cssValuePool->createValue(layers->xPosition()));1398 list->append( cssValuePool->createValue(layers->yPosition()));1397 list->append(zoomAdjustedPixelValueForLength(layers->xPosition(), style.get(), cssValuePool)); 1398 list->append(zoomAdjustedPixelValueForLength(layers->yPosition(), style.get(), cssValuePool)); 1399 1399 return list.release(); 1400 1400 } … … 1403 1403 for (const FillLayer* currLayer = layers; currLayer; currLayer = currLayer->next()) { 1404 1404 RefPtr<CSSValueList> positionList = CSSValueList::createSpaceSeparated(); 1405 positionList->append( cssValuePool->createValue(currLayer->xPosition()));1406 positionList->append( cssValuePool->createValue(currLayer->yPosition()));1405 positionList->append(zoomAdjustedPixelValueForLength(currLayer->xPosition(), style.get(), cssValuePool)); 1406 positionList->append(zoomAdjustedPixelValueForLength(currLayer->xPosition(), style.get(), cssValuePool)); 1407 1407 list->append(positionList); 1408 1408 } … … 1742 1742 if (maxHeight.isUndefined()) 1743 1743 return cssValuePool->createIdentifierValue(CSSValueNone); 1744 return cssValuePool->createValue(maxHeight);1744 return zoomAdjustedPixelValueForLength(maxHeight, style.get(), cssValuePool); 1745 1745 } 1746 1746 case CSSPropertyMaxWidth: { … … 1748 1748 if (maxWidth.isUndefined()) 1749 1749 return cssValuePool->createIdentifierValue(CSSValueNone); 1750 return cssValuePool->createValue(maxWidth);1750 return zoomAdjustedPixelValueForLength(maxWidth, style.get(), cssValuePool); 1751 1751 } 1752 1752 case CSSPropertyMinHeight: 1753 return cssValuePool->createValue(style->minHeight());1753 return zoomAdjustedPixelValueForLength(style->minHeight(), style.get(), cssValuePool); 1754 1754 case CSSPropertyMinWidth: 1755 return cssValuePool->createValue(style->minWidth());1755 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get(), cssValuePool); 1756 1756 case CSSPropertyOpacity: 1757 1757 return cssValuePool->createValue(style->opacity(), CSSPrimitiveValue::CSS_NUMBER); … … 1777 1777 if (renderer && renderer->isBox()) 1778 1778 return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingTop(false), style.get(), cssValuePool); 1779 return cssValuePool->createValue(style->paddingTop());1779 return zoomAdjustedPixelValueForLength(style->paddingTop(), style.get(), cssValuePool); 1780 1780 case CSSPropertyPaddingRight: 1781 1781 if (renderer && renderer->isBox()) 1782 1782 return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingRight(false), style.get(), cssValuePool); 1783 return cssValuePool->createValue(style->paddingRight());1783 return zoomAdjustedPixelValueForLength(style->paddingRight(), style.get(), cssValuePool); 1784 1784 case CSSPropertyPaddingBottom: 1785 1785 if (renderer && renderer->isBox()) 1786 1786 return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingBottom(false), style.get(), cssValuePool); 1787 return cssValuePool->createValue(style->paddingBottom());1787 return zoomAdjustedPixelValueForLength(style->paddingBottom(), style.get(), cssValuePool); 1788 1788 case CSSPropertyPaddingLeft: 1789 1789 if (renderer && renderer->isBox()) 1790 1790 return zoomAdjustedPixelValue(toRenderBox(renderer)->paddingLeft(false), style.get(), cssValuePool); 1791 return cssValuePool->createValue(style->paddingLeft());1791 return zoomAdjustedPixelValueForLength(style->paddingLeft(), style.get(), cssValuePool); 1792 1792 case CSSPropertyPageBreakAfter: 1793 1793 return cssValuePool->createValue(style->pageBreakAfter()); … … 1840 1840 } 1841 1841 case CSSPropertyTextIndent: 1842 return cssValuePool->createValue(style->textIndent());1842 return zoomAdjustedPixelValueForLength(style->textIndent(), style.get(), cssValuePool); 1843 1843 case CSSPropertyTextShadow: 1844 1844 return valueForShadow(style->textShadow(), propertyID, style.get());
Note:
See TracChangeset
for help on using the changeset viewer.