Changeset 74045 in webkit


Ignore:
Timestamp:
Dec 14, 2010 11:34:32 AM (13 years ago)
Author:
Beth Dakin
Message:

WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=50974
getComputedStyle() returns wrong values for zoomed elements when
display is none
-and corresponding-
<rdar://problem/8522731>

Reviewed by Darin Adler.

If there is no renderer but the RenderStyle's value is a fixed
length, send it through zoomAdjustedPixelValue(). There's not much
we can do for other length types without a renderer.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::zoomAdjustedPixelValueForLength):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):

LayoutTests: New test for https://bugs.webkit.org/show_bug.cgi?id=50974
getComputedStyle() returns wrong values for zoomed elements when
display is none
-and corresponding-
<rdar://problem/8522731>

Reviewed by Darin Adler.

  • fast/css/getComputedStyle/zoom-on-display-none-expected.txt: Added.
  • fast/css/getComputedStyle/zoom-on-display-none.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r74042 r74045  
     12010-12-14  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        New test for https://bugs.webkit.org/show_bug.cgi?id=50974
     6        getComputedStyle() returns wrong values for zoomed elements when
     7        display is none
     8        -and corresponding-
     9        <rdar://problem/8522731>
     10
     11        * fast/css/getComputedStyle/zoom-on-display-none-expected.txt: Added.
     12        * fast/css/getComputedStyle/zoom-on-display-none.html: Added.
     13
    1142010-12-14  Pavel Feldman  <pfeldman@chromium.org>
    215
  • trunk/WebCore/ChangeLog

    r74044 r74045  
     12010-12-14  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Fix for https://bugs.webkit.org/show_bug.cgi?id=50974
     6        getComputedStyle() returns wrong values for zoomed elements when
     7        display is none
     8        -and corresponding-
     9        <rdar://problem/8522731>
     10
     11        If there is no renderer but the RenderStyle's value is a fixed
     12        length, send it through zoomAdjustedPixelValue(). There's not much
     13        we can do for other length types without a renderer.
     14        * css/CSSComputedStyleDeclaration.cpp:
     15        (WebCore::zoomAdjustedPixelValueForLength):
     16        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
     17
    1182010-12-13  Dimitri Glazkov  <dglazkov@chromium.org>
    219
  • trunk/WebCore/css/CSSComputedStyleDeclaration.cpp

    r73219 r74045  
    341341}
    342342
     343static PassRefPtr<CSSValue> zoomAdjustedPixelValueForLength(const Length& length, const RenderStyle* style)
     344{
     345    if (length.isFixed())
     346        return zoomAdjustedPixelValue(length.value(), style);
     347    return CSSPrimitiveValue::create(length);
     348}
     349
    343350static PassRefPtr<CSSValue> valueForReflection(const StyleReflection* reflection, const RenderStyle* style)
    344351{
     
    10631070            if (renderer)
    10641071                return zoomAdjustedPixelValue(sizingBox(renderer).height(), style.get());
    1065             return CSSPrimitiveValue::create(style->height());
     1072            return zoomAdjustedPixelValueForLength(style->height(), style.get());
    10661073        case CSSPropertyWebkitHighlight:
    10671074            if (style->highlight() == nullAtom)
     
    13031310            if (renderer)
    13041311                return zoomAdjustedPixelValue(sizingBox(renderer).width(), style.get());
    1305             return CSSPrimitiveValue::create(style->width());
     1312            return zoomAdjustedPixelValueForLength(style->width(), style.get());
    13061313        case CSSPropertyWordBreak:
    13071314            return CSSPrimitiveValue::create(style->wordBreak());
     
    14751482            }
    14761483            else {
    1477                 list->append(CSSPrimitiveValue::create(style->perspectiveOriginX()));
    1478                 list->append(CSSPrimitiveValue::create(style->perspectiveOriginY()));
     1484                list->append(zoomAdjustedPixelValueForLength(style->perspectiveOriginX(), style.get()));
     1485                list->append(zoomAdjustedPixelValueForLength(style->perspectiveOriginY(), style.get()));
     1486               
    14791487            }
    14801488            return list.release();
     
    15191527                    list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get()));
    15201528            } else {
    1521                 list->append(CSSPrimitiveValue::create(style->transformOriginX()));
    1522                 list->append(CSSPrimitiveValue::create(style->transformOriginY()));
     1529                list->append(zoomAdjustedPixelValueForLength(style->transformOriginX(), style.get()));
     1530                list->append(zoomAdjustedPixelValueForLength(style->transformOriginY(), style.get()));
    15231531                if (style->transformOriginZ() != 0)
    15241532                    list->append(zoomAdjustedPixelValue(style->transformOriginZ(), style.get()));
Note: See TracChangeset for help on using the changeset viewer.