[Webkit-unassigned] [Bug 56052] percentages are incorrectly rounded in WebKit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 21 10:19:00 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=56052


Simon Fraser (smfr) <simon.fraser at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #86214|review?, commit-queue?      |review+, commit-queue-
               Flag|                            |




--- Comment #26 from Simon Fraser (smfr) <simon.fraser at apple.com>  2011-03-21 10:19:00 PST ---
(From update of attachment 86214)
View in context: https://bugs.webkit.org/attachment.cgi?id=86214&action=review

> Source/WebCore/platform/Length.h:76
> +            m_floatValue = static_cast<float>(m_floatValue*v);
> +        else        
> +            m_intValue = static_cast<int>(m_intValue*v);

Spaces around the * please.

> Source/WebCore/platform/Length.h:170
> +        if (m_isFloat)
> +            return !m_floatValue; 
> +        
> +        return !m_intValue;

Maybe slightly cleaner as return m_isFloat ? !m_floatValue : !m_intValue;

> Source/WebCore/platform/Length.h:196
> +            float fromPercent = from.isZero() ? 0.f : from.percent();
> +            float toPercent = isZero() ? 0.f : percent();

Is the 0.f required to fix a compiler issue? If not, stick with 0.

> Source/WebCore/platform/Length.h:201
> +        float fromValue = from.isZero() ? 0.f : from.value();
> +        float toValue = isZero() ? 0.f : value();

Ditto.

> Source/WebCore/rendering/AutoTableLayout.cpp:235
> +    const float epsilon = 1 / 128.0f;

It's not obvious why you chose 1/128 here.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list