Title: [112022] trunk
Revision
112022
Author
[email protected]
Date
2012-03-24 21:08:06 -0700 (Sat, 24 Mar 2012)

Log Message

ForeignObject content is zoomed two times
https://bugs.webkit.org/show_bug.cgi?id=76282

Patch by Florin Malita <[email protected]> on 2012-03-24
Reviewed by Nikolas Zimmermann.

Source/WebCore:

Test: svg/zoom/page/zoom-foreign-content.svg

Reset the effective zoom property for FO-nested content to avoid
having the zoom factor applied multiple times (zooming is handled by
the top level SVG root element).

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::adjustRenderStyle):

LayoutTests:

* platform/chromium-linux/svg/zoom/page/zoom-foreignObject-expected.png:
* platform/chromium-linux/svg/zoom/text/zoom-foreignObject-expected.png:
* platform/chromium-win/svg/zoom/page/zoom-foreignObject-expected.txt:
* platform/chromium-win/svg/zoom/text/zoom-foreignObject-expected.txt:
Rebaseline cr-linux expectations.

* platform/chromium/test_expectations.txt:
* platform/mac/test_expectations.txt:
Updated zoom-foreignObject.svg expectations, pending rebaseline.

* svg/zoom/page/zoom-foreign-content-expected.png: Added.
* svg/zoom/page/zoom-foreign-content-expected.txt: Added.
* svg/zoom/page/zoom-foreign-content.svg: Added.

* svg/zoom/page/zoom-foreignObject.svg:
* svg/zoom/text/zoom-foreignObject.svg:
Updated test to cover SVG FO text.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (112021 => 112022)


--- trunk/LayoutTests/ChangeLog	2012-03-25 04:03:03 UTC (rev 112021)
+++ trunk/LayoutTests/ChangeLog	2012-03-25 04:08:06 UTC (rev 112022)
@@ -1,3 +1,28 @@
+2012-03-24  Florin Malita  <[email protected]>
+
+        ForeignObject content is zoomed two times
+        https://bugs.webkit.org/show_bug.cgi?id=76282
+
+        Reviewed by Nikolas Zimmermann.
+
+        * platform/chromium-linux/svg/zoom/page/zoom-foreignObject-expected.png:
+        * platform/chromium-linux/svg/zoom/text/zoom-foreignObject-expected.png:
+        * platform/chromium-win/svg/zoom/page/zoom-foreignObject-expected.txt:
+        * platform/chromium-win/svg/zoom/text/zoom-foreignObject-expected.txt:
+        Rebaseline cr-linux expectations.
+
+        * platform/chromium/test_expectations.txt:
+        * platform/mac/test_expectations.txt:
+        Updated zoom-foreignObject.svg expectations, pending rebaseline.
+
+        * svg/zoom/page/zoom-foreign-content-expected.png: Added.
+        * svg/zoom/page/zoom-foreign-content-expected.txt: Added.
+        * svg/zoom/page/zoom-foreign-content.svg: Added.
+
+        * svg/zoom/page/zoom-foreignObject.svg:
+        * svg/zoom/text/zoom-foreignObject.svg:
+        Updated test to cover SVG FO text.
+
 2012-03-24  Chris Fleizach  <[email protected]>
 
         AX: Support solution to handle invalid ax text marker

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (112021 => 112022)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-03-25 04:03:03 UTC (rev 112021)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2012-03-25 04:08:06 UTC (rev 112022)
@@ -1298,6 +1298,9 @@
 BUGWK75968 MAC : svg/text/text-text-05-t.svg = TEXT
 
 
+// Updated tests need Win & Mac rebaselining after landing 76282
+BUGWK76282 WIN MAC : svg/zoom/page/zoom-foreignObject.svg = IMAGE+TEXT IMAGE TEXT PASS
+BUGWK76282 WIN MAC : svg/zoom/text/zoom-foreignObject.svg = IMAGE+TEXT IMAGE TEXT PASS
 
 
 // Windows and Mac need rebaselining after 53378 patch.

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-foreignObject-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/text/zoom-foreignObject-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-win/svg/zoom/page/zoom-foreignObject-expected.txt (112021 => 112022)


--- trunk/LayoutTests/platform/chromium-win/svg/zoom/page/zoom-foreignObject-expected.txt	2012-03-25 04:03:03 UTC (rev 112021)
+++ trunk/LayoutTests/platform/chromium-win/svg/zoom/page/zoom-foreignObject-expected.txt	2012-03-25 04:08:06 UTC (rev 112022)
@@ -1,15 +1,33 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (13,13) size 787x587
-    RenderSVGForeignObject {foreignObject} at (10,10) size 580x380
-      RenderBlock {xhtml:div} at (0,0) size 580x20
-        RenderText {#text} at (0,0) size 74x19
-          text run at (0,0) width 74: "This is a test"
-      RenderBlock (anonymous) at (0,20) size 580x20
+  RenderSVGRoot {svg} at (0,0) size 800x600
+    RenderSVGForeignObject {foreignObject} at (0,0) size 250x200
+      RenderBlock {xhtml:div} at (0,0) size 250x20
+        RenderText {#text} at (0,0) size 75x19
+          text run at (0,0) width 75: "This is a text"
+      RenderBlock (anonymous) at (0,20) size 250x20
         RenderInline {xhtml:a} at (0,0) size 62x19 [color=#0000EE]
           RenderText {#text} at (0,0) size 62x19
             text run at (0,0) width 62: "and a link."
         RenderBR {xhtml:br} at (62,0) size 0x19
-    RenderSVGRect {rect} at (13,13) size 787x550 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]
+      RenderBlock {xhtml:div} at (0,40) size 250x20
+        RenderText {#text} at (0,0) size 53x19
+          text run at (0,0) width 53: "[HTML]"
+    RenderSVGRect {rect} at (0,0) size 361x289 [stroke={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=250.00] [height=200.00]
+    RenderSVGForeignObject {foreignObject} at (260,0) size 250x200
+      RenderSVGRoot {svg} at (260,3) size 250x200
+        RenderSVGContainer {g} at (260,3) size 250x200 [transform={m=((3.00,0.26)(0.26,3.02)) t=(0.00,0.00)}]
+          RenderSVGText {text} at (0,1) size 81x19 contains 1 chunk(s)
+            RenderSVGInlineText {#text} at (0,0) size 81x19
+              chunk 1 text run 1 at (0.00,16.00) startOffset 0 endOffset 14 width 80.06: "This is a text"
+          RenderSVGContainer {a} at (265,60) size 201x75
+            RenderSVGText {text} at (0,20) size 65x19 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 65x19
+                chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 11 width 64.51: "and a link."
+          RenderSVGText {text} at (0,41) size 43x19 contains 1 chunk(s)
+            RenderSVGInlineText {#text} at (0,0) size 43x19
+              chunk 1 text run 1 at (0.00,56.00) startOffset 0 endOffset 5 width 42.67: "[SVG]"
+      RenderText {#text} at (0,0) size 0x0
+    RenderSVGRect {rect} at (373,0) size 363x289 [stroke={[type=SOLID] [color=#008000]}] [x=260.00] [y=0.00] [width=250.00] [height=200.00]
     RenderSVGHiddenContainer {defs} at (0,0) size 0x0

Modified: trunk/LayoutTests/platform/chromium-win/svg/zoom/text/zoom-foreignObject-expected.txt (112021 => 112022)


--- trunk/LayoutTests/platform/chromium-win/svg/zoom/text/zoom-foreignObject-expected.txt	2012-03-25 04:03:03 UTC (rev 112021)
+++ trunk/LayoutTests/platform/chromium-win/svg/zoom/text/zoom-foreignObject-expected.txt	2012-03-25 04:08:06 UTC (rev 112022)
@@ -1,15 +1,33 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
-  RenderSVGRoot {svg} at (9,9) size 791x591
-    RenderSVGForeignObject {foreignObject} at (10,10) size 580x380
-      RenderBlock {xhtml:div} at (0,0) size 580x20
-        RenderText {#text} at (0,0) size 74x19
-          text run at (0,0) width 74: "This is a test"
-      RenderBlock (anonymous) at (0,20) size 580x20
+  RenderSVGRoot {svg} at (0,0) size 800x600
+    RenderSVGForeignObject {foreignObject} at (0,0) size 250x200
+      RenderBlock {xhtml:div} at (0,0) size 250x20
+        RenderText {#text} at (0,0) size 75x19
+          text run at (0,0) width 75: "This is a text"
+      RenderBlock (anonymous) at (0,20) size 250x20
         RenderInline {xhtml:a} at (0,0) size 62x19 [color=#0000EE]
           RenderText {#text} at (0,0) size 62x19
             text run at (0,0) width 62: "and a link."
         RenderBR {xhtml:br} at (62,0) size 0x19
-    RenderSVGRect {rect} at (9,9) size 582x382 [stroke={[type=SOLID] [color=#008000]}] [x=10.00] [y=10.00] [width=580.00] [height=380.00]
+      RenderBlock {xhtml:div} at (0,40) size 250x20
+        RenderText {#text} at (0,0) size 53x19
+          text run at (0,0) width 53: "[HTML]"
+    RenderSVGRect {rect} at (0,0) size 251x201 [stroke={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=250.00] [height=200.00]
+    RenderSVGForeignObject {foreignObject} at (260,0) size 250x200
+      RenderSVGRoot {svg} at (260,3) size 250x200
+        RenderSVGContainer {g} at (260,3) size 250x200 [transform={m=((3.00,0.26)(0.26,3.02)) t=(0.00,0.00)}]
+          RenderSVGText {text} at (0,1) size 81x19 contains 1 chunk(s)
+            RenderSVGInlineText {#text} at (0,0) size 81x19
+              chunk 1 text run 1 at (0.00,16.00) startOffset 0 endOffset 14 width 80.06: "This is a text"
+          RenderSVGContainer {a} at (265,60) size 201x75
+            RenderSVGText {text} at (0,20) size 65x19 contains 1 chunk(s)
+              RenderSVGInlineText {#text} at (0,0) size 65x19
+                chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 11 width 64.51: "and a link."
+          RenderSVGText {text} at (0,41) size 43x19 contains 1 chunk(s)
+            RenderSVGInlineText {#text} at (0,0) size 43x19
+              chunk 1 text run 1 at (0.00,56.00) startOffset 0 endOffset 5 width 42.67: "[SVG]"
+      RenderText {#text} at (0,0) size 0x0
+    RenderSVGRect {rect} at (259,0) size 252x201 [stroke={[type=SOLID] [color=#008000]}] [x=260.00] [y=0.00] [width=250.00] [height=200.00]
     RenderSVGHiddenContainer {defs} at (0,0) size 0x0

Modified: trunk/LayoutTests/platform/mac/test_expectations.txt (112021 => 112022)


--- trunk/LayoutTests/platform/mac/test_expectations.txt	2012-03-25 04:03:03 UTC (rev 112021)
+++ trunk/LayoutTests/platform/mac/test_expectations.txt	2012-03-25 04:08:06 UTC (rev 112022)
@@ -210,6 +210,10 @@
 BUGWK69210: fast/inline/continuation-outlines-with-layers.html = TEXT
 BUGWK69210: fast/repaint/transform-absolute-in-positioned-container.html = TEXT
 
+// Need rebaselining after 76282
+BUGWK76282 : svg/zoom/page/zoom-foreignObject.svg = IMAGE+TEXT IMAGE TEXT PASS
+BUGWK76282 : svg/zoom/text/zoom-foreignObject.svg = IMAGE+TEXT IMAGE TEXT PASS
+
 // Those tests need a text baseline after lazily allocating layers.
 // The change should only be layer removal.
 BUGWK75568 : animations/combo-transform-translate+scale.html = TEXT

Added: trunk/LayoutTests/svg/zoom/page/zoom-foreign-content-expected.png (0 => 112022)


--- trunk/LayoutTests/svg/zoom/page/zoom-foreign-content-expected.png	                        (rev 0)
+++ trunk/LayoutTests/svg/zoom/page/zoom-foreign-content-expected.png	2012-03-25 04:08:06 UTC (rev 112022)
@@ -0,0 +1,7 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksum44d4003a3ac1b2f04cedd4e230b33526F]/
+\xCEIDATx\x9C\xED\xD9Q
+\x83@DAh\xAA\xA3*\xC0K\xB5\x9CQj\xE2\x95K茂\xFD|ɮ\xCBg\x81k\x8C}\xEFc\xF6
+\xF8\xB9\xC7\xECw#\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0bϱ\x8F\xD9\xF8\xDBk\x9B=\xAE\xB0\x9E\xE79{\xC0\xAD\xB8b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b_\x8AK\xD3I35\xA0IEND\xAEB`\x82
\ No newline at end of file

Added: trunk/LayoutTests/svg/zoom/page/zoom-foreign-content-expected.txt (0 => 112022)


--- trunk/LayoutTests/svg/zoom/page/zoom-foreign-content-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/zoom/page/zoom-foreign-content-expected.txt	2012-03-25 04:08:06 UTC (rev 112022)
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (0,0) size 800x600
+    RenderSVGForeignObject {foreignObject} at (0,0) size 800x600
+      RenderSVGRoot {svg} at (0,0) size 99x99
+        RenderSVGRect {rect} at (0,0) size 99x99 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=99.00] [height=99.00]
+      RenderText {#text} at (0,0) size 0x0
+    RenderSVGForeignObject {foreignObject} at (0,0) size 800x600
+      RenderBlock {html} at (0,0) size 800x99
+        RenderBlock {div} at (0,0) size 99x99 [bgcolor=#FF0000]
+    RenderSVGRect {rect} at (0,0) size 208x208 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0

Added: trunk/LayoutTests/svg/zoom/page/zoom-foreign-content.svg (0 => 112022)


--- trunk/LayoutTests/svg/zoom/page/zoom-foreign-content.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/zoom/page/zoom-foreign-content.svg	2012-03-25 04:08:06 UTC (rev 112022)
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" _onload_="runRepaintTest()">
+    <!-- This test verifies that foreignObject content does not have the zoom factor applied twice. -->
+
+    <foreignObject width="800" height="600">
+        <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+            <rect width="99" height="99" fill="red"/>
+        </svg>
+    </foreignObject>
+
+    <foreignObject width="800" height="600">
+        <html xmlns="http://www.w3.org/1999/xhtml">
+            <div style="background-color: red; width: 99px; height: 99px;"></div>
+        </html>
+    </foreignObject>
+
+    <!-- After zooming, this rect should still be obscuring everything. -->
+    <rect width="100" height="100" fill="green"/>
+
+    <defs>
+        <script>var zoomCount = 4;</script>
+        <script xlink:href=""
+        <script xlink:href=""
+    </defs>
+</svg>

Modified: trunk/LayoutTests/svg/zoom/page/zoom-foreignObject.svg (112021 => 112022)


--- trunk/LayoutTests/svg/zoom/page/zoom-foreignObject.svg	2012-03-25 04:03:03 UTC (rev 112021)
+++ trunk/LayoutTests/svg/zoom/page/zoom-foreignObject.svg	2012-03-25 04:08:06 UTC (rev 112022)
@@ -2,12 +2,29 @@
 <svg xmlns="http://www.w3.org/2000/svg" _onload_="runRepaintTest()"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:xhtml="http://www.w3.org/1999/xhtml">
-<foreignObject x="10" y="10" width="580" height="380" transform="scale(5) skewY(5) skewX(5)">
-<xhtml:div>This is a test</xhtml:div>
-<xhtml:a href="" a link.</xhtml:a><xhtml:br/>
+
+<!-- HTML FO text -->
+<foreignObject width="250" height="200" transform="scale(3) skewY(5) skewX(5)">
+  <xhtml:div>This is a text</xhtml:div>
+  <xhtml:a href="" a link.</xhtml:a><xhtml:br/>
+  <xhtml:div>[HTML]</xhtml:div>
 </foreignObject>
-<rect x="10" y="10" width="580" height="380" stroke="green" fill="none" />
+<rect width="250" height="200" stroke="green" fill="none" />
 
+<!-- SVG FO text -->
+<foreignObject x="260" width="250" height="200">
+  <svg xmlns="http://www.w3.org/2000/svg">
+    <g transform="scale(3) skewY(5) skewX(5)">
+      <text y="16">This is a text</text>
+      <a xlink:href=""
+        <text y="35" fill="blue" text-decoration="underline">and a link.</text>
+      </a>
+      <text y="56">[SVG]</text>
+    </g>
+  </svg>
+</foreignObject>
+<rect x="260" width="250" height="200" stroke="green" fill="none" />
+
 <defs>
   <script>var zoomCount = 2;</script>
   <script xlink:href=""

Modified: trunk/LayoutTests/svg/zoom/text/zoom-foreignObject.svg (112021 => 112022)


--- trunk/LayoutTests/svg/zoom/text/zoom-foreignObject.svg	2012-03-25 04:03:03 UTC (rev 112021)
+++ trunk/LayoutTests/svg/zoom/text/zoom-foreignObject.svg	2012-03-25 04:08:06 UTC (rev 112022)
@@ -2,12 +2,29 @@
 <svg xmlns="http://www.w3.org/2000/svg" _onload_="runRepaintTest()"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:xhtml="http://www.w3.org/1999/xhtml">
-<foreignObject x="10" y="10" width="580" height="380" transform="scale(5) skewY(5) skewX(5)">
-<xhtml:div>This is a test</xhtml:div>
-<xhtml:a href="" a link.</xhtml:a><xhtml:br/>
+
+<!-- HTML FO text -->
+<foreignObject width="250" height="200" transform="scale(3) skewY(5) skewX(5)">
+  <xhtml:div>This is a text</xhtml:div>
+  <xhtml:a href="" a link.</xhtml:a><xhtml:br/>
+  <xhtml:div>[HTML]</xhtml:div>
 </foreignObject>
-<rect x="10" y="10" width="580" height="380" stroke="green" fill="none" />
+<rect width="250" height="200" stroke="green" fill="none" />
 
+<!-- SVG FO text -->
+<foreignObject x="260" width="250" height="200">
+  <svg xmlns="http://www.w3.org/2000/svg">
+    <g transform="scale(3) skewY(5) skewX(5)">
+      <text y="16">This is a text</text>
+      <a xlink:href=""
+        <text y="35" fill="blue" text-decoration="underline">and a link.</text>
+      </a>
+      <text y="56">[SVG]</text>
+    </g>
+  </svg>
+</foreignObject>
+<rect x="260" width="250" height="200" stroke="green" fill="none" />
+
 <defs>
   <script>var zoomCount = 2;</script>
   <script xlink:href=""

Modified: trunk/Source/WebCore/ChangeLog (112021 => 112022)


--- trunk/Source/WebCore/ChangeLog	2012-03-25 04:03:03 UTC (rev 112021)
+++ trunk/Source/WebCore/ChangeLog	2012-03-25 04:08:06 UTC (rev 112022)
@@ -1,3 +1,19 @@
+2012-03-24  Florin Malita  <[email protected]>
+
+        ForeignObject content is zoomed two times
+        https://bugs.webkit.org/show_bug.cgi?id=76282
+
+        Reviewed by Nikolas Zimmermann.
+
+        Test: svg/zoom/page/zoom-foreign-content.svg
+
+        Reset the effective zoom property for FO-nested content to avoid
+        having the zoom factor applied multiple times (zooming is handled by
+        the top level SVG root element).
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::adjustRenderStyle):
+
 2012-03-24  Chris Fleizach  <[email protected]>
 
         AX: Support solution to handle invalid ax text marker

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (112021 => 112022)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-03-25 04:03:03 UTC (rev 112021)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2012-03-25 04:08:06 UTC (rev 112022)
@@ -2076,6 +2076,11 @@
         // Only the root <svg> element in an SVG document fragment tree honors css position
         if (!(e->hasTagName(SVGNames::svgTag) && e->parentNode() && !e->parentNode()->isSVGElement()))
             style->setPosition(RenderStyle::initialPosition());
+
+        // RenderSVGRoot handles zooming for the whole SVG subtree, so foreignObject content should
+        // not be scaled again.
+        if (e->hasTagName(SVGNames::foreignObjectTag))
+            style->setEffectiveZoom(RenderStyle::initialZoom());
     }
 #endif
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to