[webkit-reviews] review granted: [Bug 42089] reported size of image is changed when page is zoomed in (or out) : [Attachment 66250] patch v3.1

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 1 13:21:41 PDT 2010


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Peter Kasting
<pkasting at google.com>'s request for review:
Bug 42089: reported size of image is changed when page is zoomed in (or out)
https://bugs.webkit.org/show_bug.cgi?id=42089

Attachment 66250: patch v3.1
https://bugs.webkit.org/attachment.cgi?id=66250&action=review

------- Additional Comments from Simon Fraser (smfr) <simon.fraser at apple.com>
> Index: WebCore/css/CSSPrimitiveValue.cpp
> ===================================================================
> --- WebCore/css/CSSPrimitiveValue.cpp (revision 66611)
> +++ WebCore/css/CSSPrimitiveValue.cpp (working copy)
> @@ -45,6 +45,15 @@ using namespace WTF;
>  
>  namespace WebCore {
>  
> +template<typename T, T max, T min> inline T
roundForImpreciseConversion(double result)
> +{
> +    // Dimension calculations are imprecise, often resulting in values of
e.g.
> +    // 44.99998.  We need to go ahead and round if we're really close to the

> +    // next integer value.
> +    result += (result < 0) ? -0.01 : +0.01;
> +    return (result > max || result < min) ? 0 : static_cast<T>(result);
> +}

Won't this cause template instantiation for each combination of, T, min and
max? Maybe min and max would
be better as arguments to the function.

Also 'result' is an odd name for an input paramter.

r=me


More information about the webkit-reviews mailing list