Title: [151265] trunk
Revision
151265
Author
[email protected]
Date
2013-06-06 03:25:08 -0700 (Thu, 06 Jun 2013)

Log Message

SVG objects are misplaced when SVG root has CSS transform.
https://bugs.webkit.org/show_bug.cgi?id=117252

Patch by Zalan Bujtas <[email protected]> on 2013-06-06
Reviewed by Simon Fraser.

Update layer transforms for SVG if needed.

SVG root, similarly to RenderBlock needs to call RenderLayer
to get transforms updated after layout, in order to
position the transformed objects properly.

Source/WebCore:

Test: fast/transforms/transform-svg.html

* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):

LayoutTests:

* fast/transforms/transform-svg-expected.html: Added.
* fast/transforms/transform-svg.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (151264 => 151265)


--- trunk/LayoutTests/ChangeLog	2013-06-06 10:21:02 UTC (rev 151264)
+++ trunk/LayoutTests/ChangeLog	2013-06-06 10:25:08 UTC (rev 151265)
@@ -1,3 +1,19 @@
+2013-06-06  Zalan Bujtas  <[email protected]>
+
+        SVG objects are misplaced when SVG root has CSS transform.
+        https://bugs.webkit.org/show_bug.cgi?id=117252
+
+        Reviewed by Simon Fraser.
+
+        Update layer transforms for SVG if needed.
+
+        SVG root, similarly to RenderBlock needs to call RenderLayer
+        to get transforms updated after layout, in order to
+        position the transformed objects properly.
+
+        * fast/transforms/transform-svg-expected.html: Added.
+        * fast/transforms/transform-svg.html: Added.
+
 2013-06-06  Zoltan Arvai  <[email protected]>
 
         [Qt] Unreviewed gardening. Rebaselining after r151205.

Added: trunk/LayoutTests/fast/transforms/transform-svg-expected.html (0 => 151265)


--- trunk/LayoutTests/fast/transforms/transform-svg-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/transforms/transform-svg-expected.html	2013-06-06 10:25:08 UTC (rev 151265)
@@ -0,0 +1,26 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<style>
+    body { 
+        padding: 0px; 
+        margin: 0px;
+    }
+
+    #svgRoot {
+	    padding: 0px;
+	    margin: 0px;
+
+        position: absolute;
+        left: 200px;
+        top: 200px;
+   }
+</style>
+</head>
+
+<body>
+    <!--This test verifies that transformed SVG elements are positioned properly.-->
+    <svg id="svgRoot" width="400px" height="400px" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
+        <circle id="circle" cx="100" cy="100" r="10"/>
+    </svg>
+</body>
+</html>

Added: trunk/LayoutTests/fast/transforms/transform-svg.html (0 => 151265)


--- trunk/LayoutTests/fast/transforms/transform-svg.html	                        (rev 0)
+++ trunk/LayoutTests/fast/transforms/transform-svg.html	2013-06-06 10:25:08 UTC (rev 151265)
@@ -0,0 +1,24 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<style>
+    body { 
+        padding: 0px; 
+        margin: 0px;
+    }
+
+    #svgRoot {
+        padding: 0px;
+        margin: 0px;
+
+        -webkit-transform: translate(50%, 50%);
+   }
+</style>
+</head>
+
+<body>
+    <!--This test verifies that transformed SVG elements are positioned properly.-->
+    <svg id="svgRoot" width="400px" height="400px" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg">
+        <circle id="circle" cx="100" cy="100" r="10"/>
+    </svg>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (151264 => 151265)


--- trunk/Source/WebCore/ChangeLog	2013-06-06 10:21:02 UTC (rev 151264)
+++ trunk/Source/WebCore/ChangeLog	2013-06-06 10:25:08 UTC (rev 151265)
@@ -1,3 +1,21 @@
+2013-06-06  Zalan Bujtas  <[email protected]>
+
+        SVG objects are misplaced when SVG root has CSS transform.
+        https://bugs.webkit.org/show_bug.cgi?id=117252
+
+        Reviewed by Simon Fraser.
+
+        Update layer transforms for SVG if needed.
+
+        SVG root, similarly to RenderBlock needs to call RenderLayer
+        to get transforms updated after layout, in order to
+        position the transformed objects properly.
+
+        Test: fast/transforms/transform-svg.html
+
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::layout):
+
 2013-06-06  Jae Hyun Park  <[email protected]>
 
         Coordinated Graphics : Refactor CoordinatedSurface to manage the lifecycle of GraphicsContext

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (151264 => 151265)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2013-06-06 10:21:02 UTC (rev 151264)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2013-06-06 10:25:08 UTC (rev 151265)
@@ -259,6 +259,8 @@
         m_needsBoundariesOrTransformUpdate = false;
     }
 
+    updateLayerTransform();
+
     repainter.repaintAfterLayout();
 
     setNeedsLayout(false);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to