Changeset 53684 in webkit


Ignore:
Timestamp:
Jan 22, 2010 12:20:22 AM (14 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/7568696> Zoom applied to embedded SVG incorrectly
https://bugs.webkit.org/show_bug.cgi?id=33988

Reviewed by Darin Adler.

WebCore:

Test: svg/custom/text-zoom.xhtml

  • svg/SVGSVGElement.cpp:

(WebCore::SVGSVGElement::SVGSVGElement): Initialize m_scale.
(WebCore::SVGSVGElement::currentScale): If this is the document element,
return the frame’s zoom factor. Otherwise, return m_scale.
(WebCore::SVGSVGElement::setCurrentScale): If this is the document element,
set the frame’s zoom factor. Otherwise, set m_scale and mark for layout.

  • svg/SVGSVGElement.h: Added m_scale member.

LayoutTests:

  • svg/custom/text-zoom-expected.checksum: Added.
  • svg/custom/text-zoom-expected.png: Added.
  • svg/custom/text-zoom-expected.txt: Added.
  • svg/custom/text-zoom.xhtml: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r53680 r53684  
     12010-01-22  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        <rdar://problem/7568696> Zoom applied to embedded SVG incorrectly
     6        https://bugs.webkit.org/show_bug.cgi?id=33988
     7
     8        * svg/custom/text-zoom-expected.checksum: Added.
     9        * svg/custom/text-zoom-expected.png: Added.
     10        * svg/custom/text-zoom-expected.txt: Added.
     11        * svg/custom/text-zoom.xhtml: Added.
     12
    1132010-01-21  Tony Chang  <tony@chromium.org>
    214
  • trunk/WebCore/ChangeLog

    r53681 r53684  
     12010-01-22  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        <rdar://problem/7568696> Zoom applied to embedded SVG incorrectly
     6        https://bugs.webkit.org/show_bug.cgi?id=33988
     7
     8        Test: svg/custom/text-zoom.xhtml
     9
     10        * svg/SVGSVGElement.cpp:
     11        (WebCore::SVGSVGElement::SVGSVGElement): Initialize m_scale.
     12        (WebCore::SVGSVGElement::currentScale): If this is the document element,
     13        return the frame’s zoom factor. Otherwise, return m_scale.
     14        (WebCore::SVGSVGElement::setCurrentScale): If this is the document element,
     15        set the frame’s zoom factor. Otherwise, set m_scale and mark for layout.
     16        * svg/SVGSVGElement.h: Added m_scale member.
     17
    1182010-01-21  Adam Barth  <abarth@webkit.org>
    219
  • trunk/WebCore/svg/SVGSVGElement.cpp

    r52866 r53684  
    7373    , m_useCurrentView(false)
    7474    , m_timeContainer(SMILTimeContainer::create(this))
     75    , m_scale(1)
    7576    , m_viewSpec(0)
    7677    , m_containerSize(300, 150)
     
    190191float SVGSVGElement::currentScale() const
    191192{
    192     if (document() && document()->frame())
    193         return document()->frame()->zoomFactor();
    194     return 1.0f;
     193    if (document() && parentNode() == document())
     194        return document()->frame() ? document()->frame()->zoomFactor() : 1;
     195    return m_scale;
    195196}
    196197
    197198void SVGSVGElement::setCurrentScale(float scale)
    198199{
    199     if (document() && document()->frame())
    200         document()->frame()->setZoomFactor(scale, true);
     200    if (document() && parentNode() == document()) {
     201        if (document()->frame())
     202            document()->frame()->setZoomFactor(scale, true);
     203        return;
     204    }
     205
     206    m_scale = scale;
     207    if (renderer())
     208        renderer()->setNeedsLayout(true);
    201209}
    202210
  • trunk/WebCore/svg/SVGSVGElement.h

    r53229 r53684  
    155155        RefPtr<SMILTimeContainer> m_timeContainer;
    156156        FloatPoint m_translation;
     157        float m_scale;
    157158        mutable OwnPtr<SVGViewSpec> m_viewSpec;
    158159        IntSize m_containerSize;
Note: See TracChangeset for help on using the changeset viewer.