Changeset 142824 in webkit


Ignore:
Timestamp:
Feb 13, 2013 5:02:59 PM (11 years ago)
Author:
eae@chromium.org
Message:

getComputedStyle returns truncated value for margin-right
https://bugs.webkit.org/show_bug.cgi?id=109759

Source/WebCore:

Reviewed by Tony Chang.

Due to an unfortunate cast in CSSComputedStyleDeclaration::
getPropertyCSSValue getComputedStyle returns truncated styles
for margin-right in cases where it isn't set to a specific pixel
value.

Test: fast/sub-pixel/computedstylemargin.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
Change type of temporary value variable to float to prevent loss of precision.

LayoutTests:

Reviewed by Tony Chang.

Add test for getComputedStyle with fractional margin values.

  • fast/sub-pixel/computedstylemargin-expected.txt: Added.
  • fast/sub-pixel/computedstylemargin.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142821 r142824  
     12013-02-13  Emil A Eklund  <eae@chromium.org>
     2
     3        getComputedStyle returns truncated value for margin-right
     4        https://bugs.webkit.org/show_bug.cgi?id=109759
     5
     6        Reviewed by Tony Chang.
     7       
     8        Add test for getComputedStyle with fractional margin values.
     9
     10        * fast/sub-pixel/computedstylemargin-expected.txt: Added.
     11        * fast/sub-pixel/computedstylemargin.html: Added.
     12
    1132013-02-13  Levi Weintraub  <leviw@chromium.org>
    214
  • trunk/LayoutTests/platform/chromium/fast/css/getComputedStyle/getComputedStyle-margin-percentage-expected.txt

    r129656 r142824  
    33margin-left: 258.71875px
    44margin-top: 78.390625px
    5 margin-right: 113px
     5margin-right: 113.28125px
    66margin-bottom: 0px
    77Test
  • trunk/LayoutTests/platform/efl/fast/css/getComputedStyle/getComputedStyle-margin-percentage-expected.txt

    r140250 r142824  
    33margin-left: 258.71875px
    44margin-top: 78.390625px
    5 margin-right: 113px
     5margin-right: 113.28125px
    66margin-bottom: 0px
    77Test
  • trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/getComputedStyle-margin-percentage-expected.txt

    r133351 r142824  
    33margin-left: 258.71875px
    44margin-top: 78.390625px
    5 margin-right: 113px
     5margin-right: 113.28125px
    66margin-bottom: 0px
    77Test
  • trunk/Source/WebCore/ChangeLog

    r142823 r142824  
     12013-02-13  Emil A Eklund  <eae@chromium.org>
     2
     3        getComputedStyle returns truncated value for margin-right
     4        https://bugs.webkit.org/show_bug.cgi?id=109759
     5
     6        Reviewed by Tony Chang.
     7       
     8        Due to an unfortunate cast in CSSComputedStyleDeclaration::
     9        getPropertyCSSValue getComputedStyle returns truncated styles
     10        for margin-right in cases where it isn't set to a specific pixel
     11        value.
     12
     13        Test: fast/sub-pixel/computedstylemargin.html
     14
     15        * css/CSSComputedStyleDeclaration.cpp:
     16        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     17        Change type of temporary value variable to float to prevent loss of precision.
     18
    1192013-02-13  Max Vujovic  <mvujovic@adobe.com>
    220
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r142444 r142824  
    20092009            if (marginRight.isFixed() || !renderer || !renderer->isBox())
    20102010                return zoomAdjustedPixelValueForLength(marginRight, style.get());
    2011             int value;
     2011            float value;
    20122012            if (marginRight.isPercent() || marginRight.isViewportPercentage())
    20132013                // RenderBox gives a marginRight() that is the distance between the right-edge of the child box
Note: See TracChangeset for help on using the changeset viewer.