Changeset 14067 in webkit


Ignore:
Timestamp:
Apr 25, 2006 3:35:33 PM (18 years ago)
Author:
bdakin
Message:

Reviewed by Maciej.

Fix for <rdar://problem/4518632> getComputedStyle returns 'auto'
for dimensions like 'margin-left'

  • css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): For margin and padding, to match Firefox we now go to the renderer to get the property value instead of calling valueForLength() on the style attribute. valueForLength() will return the string 'auto' if that was what was specified in the CSS, or a percentage if it was specified as a percent. But to match Firefox, we always want to return a pixel value for margin and padding.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r14058 r14067  
     12006-04-25  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Maciej.
     4
     5        Layout test for <rdar://problem/4518632> getComputedStyle returns
     6        'auto' for dimensions like 'margin-left'
     7
     8        * fast/css/marginComputedStyle-expected.checksum: Added.
     9        * fast/css/marginComputedStyle-expected.png: Added.
     10        * fast/css/marginComputedStyle-expected.txt: Added.
     11        * fast/css/marginComputedStyle.html: Added.
     12
    1132006-04-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
    214
  • trunk/WebCore/ChangeLog

    r14058 r14067  
     12006-04-25  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Maciej.
     4
     5        Fix for <rdar://problem/4518632> getComputedStyle returns 'auto'
     6        for dimensions like 'margin-left'
     7
     8        * css/CSSComputedStyleDeclaration.cpp:
     9        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): For
     10        margin and padding, to match Firefox we now go to the renderer to
     11        get the property value instead of calling valueForLength() on the
     12        style attribute. valueForLength() will return the string 'auto' if
     13        that was what was specified in the CSS, or a percentage if it was
     14        specified as a percent. But to match Firefox, we always want to
     15        return a pixel value for margin and padding.
     16
    1172006-04-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
    218
  • trunk/WebCore/css/CSSComputedStyleDeclaration.cpp

    r13959 r14067  
    787787        return 0;
    788788    case CSS_PROP_MARGIN_TOP:
    789         return valueForLength(style->marginTop());
     789        return new CSSPrimitiveValue(renderer->marginTop(), CSSPrimitiveValue::CSS_PX);
    790790    case CSS_PROP_MARGIN_RIGHT:
    791         return valueForLength(style->marginRight());
     791        return new CSSPrimitiveValue(renderer->marginRight(), CSSPrimitiveValue::CSS_PX);
    792792    case CSS_PROP_MARGIN_BOTTOM:
    793         return valueForLength(style->marginBottom());
     793        return new CSSPrimitiveValue(renderer->marginBottom(), CSSPrimitiveValue::CSS_PX);
    794794    case CSS_PROP_MARGIN_LEFT:
    795         return valueForLength(style->marginLeft());
     795        return new CSSPrimitiveValue(renderer->marginLeft(), CSSPrimitiveValue::CSS_PX);
    796796    case CSS_PROP__WEBKIT_MARQUEE:
    797797        // FIXME: unimplemented
     
    894894        return 0;
    895895    case CSS_PROP_PADDING_TOP:
    896         return valueForLength(style->paddingTop());
     896        return new CSSPrimitiveValue(renderer->paddingTop(), CSSPrimitiveValue::CSS_PX);
    897897    case CSS_PROP_PADDING_RIGHT:
    898         return valueForLength(style->paddingRight());
     898        return new CSSPrimitiveValue(renderer->paddingRight(), CSSPrimitiveValue::CSS_PX);
    899899    case CSS_PROP_PADDING_BOTTOM:
    900         return valueForLength(style->paddingBottom());
     900        return new CSSPrimitiveValue(renderer->paddingBottom(), CSSPrimitiveValue::CSS_PX);
    901901    case CSS_PROP_PADDING_LEFT:
    902         return valueForLength(style->paddingLeft());
     902        return new CSSPrimitiveValue(renderer->paddingLeft(), CSSPrimitiveValue::CSS_PX);
    903903    case CSS_PROP_PAGE:
    904904        // FIXME: unimplemented
Note: See TracChangeset for help on using the changeset viewer.