Title: [106303] branches/subpixellayout/Source/WebCore/css
Revision
106303
Author
e...@chromium.org
Date
2012-01-30 17:07:00 -0800 (Mon, 30 Jan 2012)

Log Message

Change computed style calculations to round/truncate values at query as opposed to computation time to avoid loosing precision when adjusting values for zoom.

Modified Paths

Diff

Modified: branches/subpixellayout/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (106302 => 106303)


--- branches/subpixellayout/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-01-31 01:04:43 UTC (rev 106302)
+++ branches/subpixellayout/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-01-31 01:07:00 UTC (rev 106303)
@@ -504,9 +504,9 @@
     return createBorderImageValue(imageValue, imageSlices, borderSlices, outset, repeat);
 }
 
-inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(int value, const RenderStyle* style, CSSValuePool* cssValuePool)
+inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedPixelValue(double value, const RenderStyle* style, CSSValuePool* cssValuePool)
 {
-    return cssValuePool->createValue(adjustForAbsoluteZoom(value, style), CSSPrimitiveValue::CSS_PX);
+    return cssValuePool->createValue(adjustFloatForAbsoluteZoom(value, style), CSSPrimitiveValue::CSS_PX);
 }
 
 inline static PassRefPtr<CSSPrimitiveValue> zoomAdjustedNumberValue(double value, const RenderStyle* style, CSSValuePool* cssValuePool)

Modified: branches/subpixellayout/Source/WebCore/css/CSSPrimitiveValue.cpp (106302 => 106303)


--- branches/subpixellayout/Source/WebCore/css/CSSPrimitiveValue.cpp	2012-01-31 01:04:43 UTC (rev 106302)
+++ branches/subpixellayout/Source/WebCore/css/CSSPrimitiveValue.cpp	2012-01-31 01:07:00 UTC (rev 106303)
@@ -740,7 +740,7 @@
             text = formatNumber(m_value.num) + "rem";
             break;
         case CSS_PX:
-            text = formatNumber(m_value.num) + "px";
+            text = formatNumber(static_cast<int>(m_value.num)) + "px";
             break;
         case CSS_CM:
             text = formatNumber(m_value.num) + "cm";
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to