[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

mitz at apple.com mitz at apple.com
Thu Feb 4 21:24:32 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit ef694b63b1a0de6b86338f60050aa665059c18d2
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 22 08:20:22 2010 +0000

    <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.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53684 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5b5bbcd..8f81968 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-22  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7568696> Zoom applied to embedded SVG incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=33988
+
+        * 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.
+
 2010-01-21  Tony Chang  <tony at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/svg/custom/text-zoom-expected.checksum b/LayoutTests/svg/custom/text-zoom-expected.checksum
new file mode 100644
index 0000000..37e9733
--- /dev/null
+++ b/LayoutTests/svg/custom/text-zoom-expected.checksum
@@ -0,0 +1 @@
+1e3fee5833e11f8231e5096c73f51df9
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/text-zoom-expected.png b/LayoutTests/svg/custom/text-zoom-expected.png
new file mode 100644
index 0000000..9b49cc5
Binary files /dev/null and b/LayoutTests/svg/custom/text-zoom-expected.png differ
diff --git a/LayoutTests/svg/custom/text-zoom-expected.txt b/LayoutTests/svg/custom/text-zoom-expected.txt
new file mode 100644
index 0000000..7f02997
--- /dev/null
+++ b/LayoutTests/svg/custom/text-zoom-expected.txt
@@ -0,0 +1,12 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x8
+  RenderBlock {html} at (0,0) size 800x8
+    RenderBody {body} at (8,8) size 784x0
+layer at (0,30) size 100x100
+  RenderBlock (positioned) {div} at (0,30) size 100x100 [bgcolor=#FF0000]
+layer at (0,30) size 200x205
+  RenderBlock (positioned) {div} at (0,30) size 200x200
+    RenderSVGRoot {svg} at (8,38) size 100x100
+      RenderPath {rect} at (8,38) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+    RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/svg/custom/text-zoom.xhtml b/LayoutTests/svg/custom/text-zoom.xhtml
new file mode 100644
index 0000000..942005b
--- /dev/null
+++ b/LayoutTests/svg/custom/text-zoom.xhtml
@@ -0,0 +1,16 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <body>
+    <div style="width: 100px; height: 100px; position: absolute; top: 30px; left: 0; background-color: red;"></div>
+    <div style="width: 200px; height: 200px; position: absolute; top: 30px; left: 0;">
+      <svg id="svgRoot" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
+        <rect id="rect" width="50%" height="50%" fill="green" />
+      </svg>
+    </div>
+  <script>
+    if (window.eventSender)
+      eventSender.textZoomIn();
+    else
+      document.body.appendChild(document.createTextNode("Use the View menu to zoom in. There should be no red."));
+  </script>
+  </body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c660715..78521a3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-01-22  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/7568696> Zoom applied to embedded SVG incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=33988
+
+        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.
+
 2010-01-21  Adam Barth  <abarth at webkit.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index 2746a77..f60aa07 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -72,6 +72,7 @@ SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc)
     , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr)
     , m_useCurrentView(false)
     , m_timeContainer(SMILTimeContainer::create(this))
+    , m_scale(1)
     , m_viewSpec(0)
     , m_containerSize(300, 150)
     , m_hasSetContainerSize(false)
@@ -189,15 +190,22 @@ SVGViewSpec* SVGSVGElement::currentView() const
 
 float SVGSVGElement::currentScale() const
 {
-    if (document() && document()->frame())
-        return document()->frame()->zoomFactor();
-    return 1.0f;
+    if (document() && parentNode() == document())
+        return document()->frame() ? document()->frame()->zoomFactor() : 1;
+    return m_scale;
 }
 
 void SVGSVGElement::setCurrentScale(float scale)
 {
-    if (document() && document()->frame())
-        document()->frame()->setZoomFactor(scale, true);
+    if (document() && parentNode() == document()) {
+        if (document()->frame())
+            document()->frame()->setZoomFactor(scale, true);
+        return;
+    }
+
+    m_scale = scale;
+    if (renderer())
+        renderer()->setNeedsLayout(true);
 }
 
 FloatPoint SVGSVGElement::currentTranslate() const
diff --git a/WebCore/svg/SVGSVGElement.h b/WebCore/svg/SVGSVGElement.h
index c956712..5a31d70 100644
--- a/WebCore/svg/SVGSVGElement.h
+++ b/WebCore/svg/SVGSVGElement.h
@@ -154,6 +154,7 @@ namespace WebCore {
         bool m_useCurrentView;
         RefPtr<SMILTimeContainer> m_timeContainer;
         FloatPoint m_translation;
+        float m_scale;
         mutable OwnPtr<SVGViewSpec> m_viewSpec;
         IntSize m_containerSize;
         bool m_hasSetContainerSize;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list