Title: [145616] branches/safari-536.30-branch

Diff

Modified: branches/safari-536.30-branch/LayoutTests/ChangeLog (145615 => 145616)


--- branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-03-12 23:49:12 UTC (rev 145615)
+++ branches/safari-536.30-branch/LayoutTests/ChangeLog	2013-03-12 23:50:08 UTC (rev 145616)
@@ -1,5 +1,22 @@
 2013-03-12  Lucas Forschler  <[email protected]>
 
+        Merge r133155
+
+    2012-11-01  Stephen Chenney  <[email protected]>
+
+            SVG as an image may recreate the renderer on zoom
+            https://bugs.webkit.org/show_bug.cgi?id=99508
+
+            Reviewed by Abhishek Arya.
+
+            Test and ref-test-result for zooming of SVG content when loaded as-image, and the svg is actually a css file.
+
+            * svg/as-image/img-zoom-svg-stylesheet-expected.html: Added.
+            * svg/as-image/img-zoom-svg-stylesheet.html: Added.
+            * svg/as-image/resources/svg-stylesheet-for-zoom.svg: Added.
+
+2013-03-12  Lucas Forschler  <[email protected]>
+
         Merge r132983
 
     2012-10-30  Kent Tamura  <[email protected]>

Copied: branches/safari-536.30-branch/LayoutTests/svg/as-image/img-zoom-svg-stylesheet-expected.html (from rev 133155, trunk/LayoutTests/svg/as-image/img-zoom-svg-stylesheet-expected.html) (0 => 145616)


--- branches/safari-536.30-branch/LayoutTests/svg/as-image/img-zoom-svg-stylesheet-expected.html	                        (rev 0)
+++ branches/safari-536.30-branch/LayoutTests/svg/as-image/img-zoom-svg-stylesheet-expected.html	2013-03-12 23:50:08 UTC (rev 145616)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+  <p>This test PASSES if you can hit &lt;Ctrl&gt;+ without crashing.</p>
+  <script>
+    if (window.eventSender)
+      eventSender.zoomPageIn();
+  </script>
+</html>
\ No newline at end of file

Copied: branches/safari-536.30-branch/LayoutTests/svg/as-image/img-zoom-svg-stylesheet.html (from rev 133155, trunk/LayoutTests/svg/as-image/img-zoom-svg-stylesheet.html) (0 => 145616)


--- branches/safari-536.30-branch/LayoutTests/svg/as-image/img-zoom-svg-stylesheet.html	                        (rev 0)
+++ branches/safari-536.30-branch/LayoutTests/svg/as-image/img-zoom-svg-stylesheet.html	2013-03-12 23:50:08 UTC (rev 145616)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+  <p>This test PASSES if you can hit &lt;Ctrl&gt;+ without crashing.</p>
+  <img style="width:10;height:10" src="" _onload_="zoomPage()"/>
+  <script>
+    function zoomPage()
+    {
+      if (window.eventSender)
+        eventSender.zoomPageIn();
+    }
+  </script>
+</html>
\ No newline at end of file

Copied: branches/safari-536.30-branch/LayoutTests/svg/as-image/resources/svg-stylesheet-for-zoom.svg (from rev 133155, trunk/LayoutTests/svg/as-image/resources/svg-stylesheet-for-zoom.svg) (0 => 145616)


--- branches/safari-536.30-branch/LayoutTests/svg/as-image/resources/svg-stylesheet-for-zoom.svg	                        (rev 0)
+++ branches/safari-536.30-branch/LayoutTests/svg/as-image/resources/svg-stylesheet-for-zoom.svg	2013-03-12 23:50:08 UTC (rev 145616)
@@ -0,0 +1,3 @@
+<?xml-stylesheet href="" type="text/css"?>
+<svg width="10" height="10" xmlns="http://www.w3.org/2000/svg">
+</svg>
\ No newline at end of file

Modified: branches/safari-536.30-branch/Source/WebCore/ChangeLog (145615 => 145616)


--- branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-12 23:49:12 UTC (rev 145615)
+++ branches/safari-536.30-branch/Source/WebCore/ChangeLog	2013-03-12 23:50:08 UTC (rev 145616)
@@ -1,5 +1,28 @@
 2013-03-12  Lucas Forschler  <[email protected]>
 
+        Merge r133155
+
+    2012-11-01  Stephen Chenney  <[email protected]>
+
+            SVG as an image may recreate the renderer on zoom
+            https://bugs.webkit.org/show_bug.cgi?id=99508
+
+            Reviewed by Abhishek Arya.
+
+            The SVGImage code, when SVG is used in <img> tags, caches the renderer
+            at the start of the painting method and re-uses the pointer at the end
+            of the method. However, when the page is zoomed the renderer may be
+            detached mid-method, thus leaving a stray pointer. The fix is to
+            re-fetch the pointer after the zooms.
+
+            Test: svg/as-image/img-zoom-svg-stylesheet.html
+
+            * svg/graphics/SVGImage.cpp:
+            (WebCore::SVGImage::drawSVGToImageBuffer): Re-fetch the renderer after
+            the zoom operations.
+
+2013-03-12  Lucas Forschler  <[email protected]>
+
         Merge r132983
 
     2012-10-30  Kent Tamura  <[email protected]>

Modified: branches/safari-536.30-branch/Source/WebCore/svg/graphics/SVGImage.cpp (145615 => 145616)


--- branches/safari-536.30-branch/Source/WebCore/svg/graphics/SVGImage.cpp	2013-03-12 23:49:12 UTC (rev 145615)
+++ branches/safari-536.30-branch/Source/WebCore/svg/graphics/SVGImage.cpp	2013-03-12 23:50:08 UTC (rev 145616)
@@ -193,7 +193,11 @@
     if (zoom != 1)
         frame->setPageZoomFactor(1);
 
-    renderer->setContainerSize(IntSize());
+    // Renderer may have been recreated by frame->setPageZoomFactor(zoom). So fetch it again.
+    renderer = toRenderSVGRoot(rootElement->renderer());
+    if (renderer)
+        renderer->setContainerSize(IntSize());
+
     frame->view()->resize(this->size());
     if (frame->view()->needsLayout())
         frame->view()->layout();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to