[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

zimmermann at webkit.org zimmermann at webkit.org
Thu Oct 29 20:41:55 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit ec8506f2150bc78572834335b3e36d74ac1e3e16
Author: zimmermann at webkit.org <zimmermann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 8 19:59:29 2009 +0000

    2009-10-08  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Eric Seidel.
    
            Move SVGFitToViewBox ANIMATED_* macros in classes that inherit from it
            https://bugs.webkit.org/show_bug.cgi?id=30230
    
            This patch also devirtualizes viewBoxToViewTransform(), is it's superflous.
            viewBoxToViewTransform() is now a simple static heper function in SVGFitToViewBox.
            As a result, the SVGSVGElement::viewBoxToViewTransform() function now resuses the same logic.
    
            As side-effect this patch fixes svg/custom/linking-a-03-b-transform.svg, the return
            statement in SVGSVGElement::viewBoxToViewTransform() was clearly wrong.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49312 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5be4adf..a72348d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-08  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Eric Seidel.
+
+        Move SVGFitToViewBox ANIMATED_* macros in classes that inherit from it
+        https://bugs.webkit.org/show_bug.cgi?id=30230
+
+        Update the results of linking-a-03-b-transform.svg, it works again.
+
+        * platform/mac/svg/custom/linking-a-03-b-transform-expected.checksum:
+        * platform/mac/svg/custom/linking-a-03-b-transform-expected.png:
+        * platform/mac/svg/custom/linking-a-03-b-transform-expected.txt:
+
 2009-10-08  Xan Lopez  <xlopez at igalia.com>
 
         Skip another failing test with reference to its bug.
diff --git a/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.checksum b/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.checksum
index 4b6cf58..706edbe 100644
--- a/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.checksum
+++ b/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.checksum
@@ -1 +1 @@
-bef1ff22cf0d1a4ca414f26570353bb5
\ No newline at end of file
+8128fe04a5256df3a865d0dc73961a41
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.png b/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.png
index 0ed3f4d..7a5bc43 100644
Binary files a/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.png and b/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.txt b/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.txt
index e2d3d81..be43d4e 100644
--- a/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.txt
+++ b/LayoutTests/platform/mac/svg/custom/linking-a-03-b-transform-expected.txt
@@ -1,23 +1,23 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 480x360
-  RenderSVGRoot {svg} at (0.50,0.50) size 479x359
-    RenderSVGContainer {g} at (63.50,9) size 331.50x326
+  RenderSVGRoot {svg} at (-61.93,0.58) size 534.06x436.72
+    RenderSVGContainer {g} at (4.36,19.89) size 383.08x378.61
       RenderSVGText {text} at (100,20) size 184x14 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-11) size 184x14
           chunk 1 text run 1 at (100.00,20.00) startOffset 0 endOffset 41 width 184.00: "Some circles with ids, for linking tests."
-      RenderPath {circle} at (184.50,104.50) size 71.00x71.00 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M255.00,140.00 L254.93,142.20 L254.72,144.39 L254.38,146.56 L253.90,148.70 L253.29,150.82 L252.54,152.88 L251.67,154.90 L250.67,156.86 L249.55,158.75 L248.32,160.57 L246.97,162.31 L245.51,163.96 L243.96,165.51 L242.31,166.97 L240.57,168.32 L238.75,169.55 L236.86,170.67 L234.90,171.67 L232.88,172.54 L230.82,173.29 L228.70,173.90 L226.56,174.38 L224.39,174.72 L222.20,174.93 L220.00,175.00 L217.80,174.93 L215.61,174.72 L213.44,174.38 L211.30,173.90 L209.18,173.29 L207.12,172.54 L205.10,171.67 L203.14,170.67 L201.25,169.55 L199.43,168.32 L197.69,166.97 L196.04,165.51 L194.49,163.96 L193.03,162.31 L191.68,160.57 L190.45,158.75 L189.33,156.86 L188.33,154.90 L187.46,152.88 L186.71,150.82 L186.10,148.70 L185.62,146.56 L185.28,144.39 L185.07,142.20 L185.00,140.00 L185.07,137.80 L185.28,135.61 L185.62,133.44 L186.10,131.30 L186.71,129.18 L187.46,127.12 L188.33,125.10 L189.33,123.14 L190.45,121.25 L191.68,119.43 L193.03,117.69 L194.49,116.04 L196.04,114.49 L197.69,113.03 L199.43,111.68 L201.25,110.45 L203.14,109.33 L205.10,108.33 L207.12,107.46 L209.18,106.71 L211.30,106.10 L213.44,105.62 L215.61,105.28 L217.80,105.07 L220.00,105.00 L222.20,105.07 L224.39,105.28 L226.56,105.62 L228.70,106.10 L230.82,106.71 L232.88,107.46 L234.90,108.33 L236.86,109.33 L238.75,110.45 L240.57,111.68 L242.31,113.03 L243.96,114.49 L245.51,116.04 L246.97,117.69 L248.32,119.43 L249.55,121.25 L250.67,123.14 L251.67,125.10 L252.54,127.12 L253.29,129.18 L253.90,131.30 L254.38,133.44 L254.72,135.61 L254.93,137.80 Z"]
+      RenderPath {circle} at (151.22,134.95) size 82.25x82.25 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M255.00,140.00 L254.93,142.20 L254.72,144.39 L254.38,146.56 L253.90,148.70 L253.29,150.82 L252.54,152.88 L251.67,154.90 L250.67,156.86 L249.55,158.75 L248.32,160.57 L246.97,162.31 L245.51,163.96 L243.96,165.51 L242.31,166.97 L240.57,168.32 L238.75,169.55 L236.86,170.67 L234.90,171.67 L232.88,172.54 L230.82,173.29 L228.70,173.90 L226.56,174.38 L224.39,174.72 L222.20,174.93 L220.00,175.00 L217.80,174.93 L215.61,174.72 L213.44,174.38 L211.30,173.90 L209.18,173.29 L207.12,172.54 L205.10,171.67 L203.14,170.67 L201.25,169.55 L199.43,168.32 L197.69,166.97 L196.04,165.51 L194.49,163.96 L193.03,162.31 L191.68,160.57 L190.45,158.75 L189.33,156.86 L188.33,154.90 L187.46,152.88 L186.71,150.82 L186.10,148.70 L185.62,146.56 L185.28,144.39 L185.07,142.20 L185.00,140.00 L185.07,137.80 L185.28,135.61 L185.62,133.44 L186.10,131.30 L186.71,129.18 L187.46,127.12 L188.33,125.10 L189.33,123.14 L190.45,121.25 L191.68,119.43 L193.03,117.69 L194.49,116.04 L196.04,114.49 L197.69,113.03 L199.43,111.68 L201.25,110.45 L203.14,109.33 L205.10,108.33 L207.12,107.46 L209.18,106.71 L211.30,106.10 L213.44,105.62 L215.61,105.28 L217.80,105.07 L220.00,105.00 L222.20,105.07 L224.39,105.28 L226.56,105.62 L228.70,106.10 L230.82,106.71 L232.88,107.46 L234.90,108.33 L236.86,109.33 L238.75,110.45 L240.57,111.68 L242.31,113.03 L243.96,114.49 L245.51,116.04 L246.97,117.69 L248.32,119.43 L249.55,121.25 L250.67,123.14 L251.67,125.10 L252.54,127.12 L253.29,129.18 L253.90,131.30 L254.38,133.44 L254.72,135.61 L254.93,137.80 Z"]
       RenderSVGText {text} at (203,99) size 40x14 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-11) size 40x14
           chunk 1 text run 1 at (203.00,99.00) startOffset 0 endOffset 8 width 40.00: "circle-1"
-      RenderPath {circle} at (78.00,238.00) size 44.00x44.00 [stroke={[type=SOLID] [color=#00FF00] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FFFF00]}] [data="M120.00,260.00 L119.96,261.26 L119.84,262.51 L119.65,263.75 L119.37,264.97 L119.02,266.18 L118.60,267.36 L118.10,268.52 L117.53,269.64 L116.89,270.72 L116.18,271.76 L115.41,272.75 L114.58,273.69 L113.69,274.58 L112.75,275.41 L111.76,276.18 L110.72,276.89 L109.64,277.53 L108.52,278.10 L107.36,278.60 L106.18,279.02 L104.97,279.37 L103.75,279.65 L102.51,279.84 L101.26,279.96 L100.00,280.00 L98.74,279.96 L97.49,279.84 L96.25,279.65 L95.03,279.37 L93.82,279.02 L92.64,278.60 L91.48,278.10 L90.36,277.53 L89.28,276.89 L88.24,276.18 L87.25,275.41 L86.31,274.58 L85.42,273.69 L84.59,272.75 L83.82,271.76 L83.11,270.72 L82.47,269.64 L81.90,268.52 L81.40,267.36 L80.98,266.18 L80.63,264.97 L80.35,263.75 L80.16,262.51 L80.04,261.26 L80.00,260.00 L80.04,258.74 L80.16,257.49 L80.35,256.25 L80.63,255.03 L80.98,253.82 L81.40,252.64 L81.90,251.48 L82.47,250.36 L83.11,249.28 L83.82,248.24 L84.59,247.25 L85.42,246.31 L86.31,245.42 L87.25,244.59 L88.24,243.82 L89.28,243.11 L90.36,242.47 L91.48,241.90 L92.64,241.40 L93.82,240.98 L95.03,240.63 L96.25,240.35 L97.49,240.16 L98.74,240.04 L100.00,240.00 L101.26,240.04 L102.51,240.16 L103.75,240.35 L104.97,240.63 L106.18,240.98 L107.36,241.40 L108.52,241.90 L109.64,242.47 L110.72,243.11 L111.76,243.82 L112.75,244.59 L113.69,245.42 L114.58,246.31 L115.41,247.25 L116.18,248.24 L116.89,249.28 L117.53,250.36 L118.10,251.48 L118.60,252.64 L119.02,253.82 L119.37,255.03 L119.65,256.25 L119.84,257.49 L119.96,258.74 Z"]
+      RenderPath {circle} at (27.85,247.93) size 50.97x50.97 [stroke={[type=SOLID] [color=#00FF00] [stroke width=4.00]}] [fill={[type=SOLID] [color=#FFFF00]}] [data="M120.00,260.00 L119.96,261.26 L119.84,262.51 L119.65,263.75 L119.37,264.97 L119.02,266.18 L118.60,267.36 L118.10,268.52 L117.53,269.64 L116.89,270.72 L116.18,271.76 L115.41,272.75 L114.58,273.69 L113.69,274.58 L112.75,275.41 L111.76,276.18 L110.72,276.89 L109.64,277.53 L108.52,278.10 L107.36,278.60 L106.18,279.02 L104.97,279.37 L103.75,279.65 L102.51,279.84 L101.26,279.96 L100.00,280.00 L98.74,279.96 L97.49,279.84 L96.25,279.65 L95.03,279.37 L93.82,279.02 L92.64,278.60 L91.48,278.10 L90.36,277.53 L89.28,276.89 L88.24,276.18 L87.25,275.41 L86.31,274.58 L85.42,273.69 L84.59,272.75 L83.82,271.76 L83.11,270.72 L82.47,269.64 L81.90,268.52 L81.40,267.36 L80.98,266.18 L80.63,264.97 L80.35,263.75 L80.16,262.51 L80.04,261.26 L80.00,260.00 L80.04,258.74 L80.16,257.49 L80.35,256.25 L80.63,255.03 L80.98,253.82 L81.40,252.64 L81.90,251.48 L82.47,250.36 L83.11,249.28 L83.82,248.24 L84.59,247.25 L85.42,246.31 L86.31,245.42 L87.25,244.59 L88.24,243.82 L89.28,243.11 L90.36,242.47 L91.48,241.90 L92.64,241.40 L93.82,240.98 L95.03,240.63 L96.25,240.35 L97.49,240.16 L98.74,240.04 L100.00,240.00 L101.26,240.04 L102.51,240.16 L103.75,240.35 L104.97,240.63 L106.18,240.98 L107.36,241.40 L108.52,241.90 L109.64,242.47 L110.72,243.11 L111.76,243.82 L112.75,244.59 L113.69,245.42 L114.58,246.31 L115.41,247.25 L116.18,248.24 L116.89,249.28 L117.53,250.36 L118.10,251.48 L118.60,252.64 L119.02,253.82 L119.37,255.03 L119.65,256.25 L119.84,257.49 L119.96,258.74 Z"]
       RenderSVGText {text} at (80,295) size 40x14 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-11) size 40x14
           chunk 1 text run 1 at (80.00,295.00) startOffset 0 endOffset 8 width 40.00: "circle-2"
-      RenderPath {rect} at (63.50,226.50) size 73x73 [stroke={[type=SOLID] [color=#000000]}] [data="M64.00,227.00 L136.00,227.00 L136.00,299.00 L64.00,299.00 Z"]
-      RenderPath {circle} at (285.00,205.00) size 110.00x110.00 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [data="M390.00,260.00 L389.90,263.14 L389.61,266.27 L389.11,269.37 L388.43,272.43 L387.55,275.45 L386.49,278.41 L385.24,281.29 L383.82,284.09 L382.22,286.79 L380.45,289.39 L378.53,291.87 L376.45,294.23 L374.23,296.45 L371.87,298.53 L369.39,300.45 L366.79,302.22 L364.09,303.82 L361.29,305.24 L358.41,306.49 L355.45,307.55 L352.43,308.43 L349.37,309.11 L346.27,309.61 L343.14,309.90 L340.00,310.00 L336.86,309.90 L333.73,309.61 L330.63,309.11 L327.57,308.43 L324.55,307.55 L321.59,306.49 L318.71,305.24 L315.91,303.82 L313.21,302.22 L310.61,300.45 L308.13,298.53 L305.77,296.45 L303.55,294.23 L301.47,291.87 L299.55,289.39 L297.78,286.79 L296.18,284.09 L294.76,281.29 L293.51,278.41 L292.45,275.45 L291.57,272.43 L290.89,269.37 L290.39,266.27 L290.10,263.14 L290.00,260.00 L290.10,256.86 L290.39,253.73 L290.89,250.63 L291.57,247.57 L292.45,244.55 L293.51,241.59 L294.76,238.71 L296.18,235.91 L297.78,233.21 L299.55,230.61 L301.47,228.13 L303.55,225.77 L305.77,223.55 L308.13,221.47 L310.61,219.55 L313.21,217.78 L315.91,216.18 L318.71,214.76 L321.59,213.51 L324.55,212.45 L327.57,211.57 L330.63,210.89 L333.73,210.39 L336.86,210.10 L340.00,210.00 L343.14,210.10 L346.27,210.39 L349.37,210.89 L352.43,211.57 L355.45,212.45 L358.41,213.51 L361.29,214.76 L364.09,216.18 L366.79,217.78 L369.39,219.55 L371.87,221.47 L374.23,223.55 L376.45,225.77 L378.53,228.13 L380.45,230.61 L382.22,233.21 L383.82,235.91 L385.24,238.71 L386.49,241.59 L387.55,244.55 L388.43,247.57 L389.11,250.63 L389.61,253.73 L389.90,256.86 Z"]
+      RenderPath {rect} at (10.53,234.09) size 84.57x84.57 [stroke={[type=SOLID] [color=#000000]}] [data="M64.00,227.00 L136.00,227.00 L136.00,299.00 L64.00,299.00 Z"]
+      RenderPath {circle} at (225.97,251.37) size 127.44x127.44 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [data="M390.00,260.00 L389.90,263.14 L389.61,266.27 L389.11,269.37 L388.43,272.43 L387.55,275.45 L386.49,278.41 L385.24,281.29 L383.82,284.09 L382.22,286.79 L380.45,289.39 L378.53,291.87 L376.45,294.23 L374.23,296.45 L371.87,298.53 L369.39,300.45 L366.79,302.22 L364.09,303.82 L361.29,305.24 L358.41,306.49 L355.45,307.55 L352.43,308.43 L349.37,309.11 L346.27,309.61 L343.14,309.90 L340.00,310.00 L336.86,309.90 L333.73,309.61 L330.63,309.11 L327.57,308.43 L324.55,307.55 L321.59,306.49 L318.71,305.24 L315.91,303.82 L313.21,302.22 L310.61,300.45 L308.13,298.53 L305.77,296.45 L303.55,294.23 L301.47,291.87 L299.55,289.39 L297.78,286.79 L296.18,284.09 L294.76,281.29 L293.51,278.41 L292.45,275.45 L291.57,272.43 L290.89,269.37 L290.39,266.27 L290.10,263.14 L290.00,260.00 L290.10,256.86 L290.39,253.73 L290.89,250.63 L291.57,247.57 L292.45,244.55 L293.51,241.59 L294.76,238.71 L296.18,235.91 L297.78,233.21 L299.55,230.61 L301.47,228.13 L303.55,225.77 L305.77,223.55 L308.13,221.47 L310.61,219.55 L313.21,217.78 L315.91,216.18 L318.71,214.76 L321.59,213.51 L324.55,212.45 L327.57,211.57 L330.63,210.89 L333.73,210.39 L336.86,210.10 L340.00,210.00 L343.14,210.10 L346.27,210.39 L349.37,210.89 L352.43,211.57 L355.45,212.45 L358.41,213.51 L361.29,214.76 L364.09,216.18 L366.79,217.78 L369.39,219.55 L371.87,221.47 L374.23,223.55 L376.45,225.77 L378.53,228.13 L380.45,230.61 L382.22,233.21 L383.82,235.91 L385.24,238.71 L386.49,241.59 L387.55,244.55 L388.43,247.57 L389.11,250.63 L389.61,253.73 L389.90,256.86 Z"]
       RenderSVGText {text} at (320,332) size 40x14 contains 1 chunk(s)
         RenderSVGInlineText {#text} at (0,-11) size 40x14
           chunk 1 text run 1 at (320.00,332.00) startOffset 0 endOffset 8 width 40.00: "circle-3"
-    RenderSVGContainer {g} at (0.50,0.50) size 479x359
-      RenderPath {rect} at (0.50,0.50) size 479x359 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00 L479.00,1.00 L479.00,359.00 L1.00,359.00 Z"]
+    RenderSVGContainer {g} at (-61.93,0.58) size 534.06x436.72
+      RenderPath {rect} at (-61.93,0.58) size 534.06x436.72 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00 L479.00,1.00 L479.00,359.00 L1.00,359.00 Z"]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f24fecf..7e5f383 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,43 @@
+2009-10-08  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Eric Seidel.
+
+        Move SVGFitToViewBox ANIMATED_* macros in classes that inherit from it
+        https://bugs.webkit.org/show_bug.cgi?id=30230
+
+        This patch also devirtualizes viewBoxToViewTransform(), is it's superflous.
+        viewBoxToViewTransform() is now a simple static heper function in SVGFitToViewBox.
+        As a result, the SVGSVGElement::viewBoxToViewTransform() function now resuses the same logic.
+
+        As side-effect this patch fixes svg/custom/linking-a-03-b-transform.svg, the return
+        statement in SVGSVGElement::viewBoxToViewTransform() was clearly wrong.
+
+        * svg/SVGFitToViewBox.cpp:
+        (WebCore::SVGFitToViewBox::SVGFitToViewBox):
+        (WebCore::SVGFitToViewBox::viewBoxToViewTransform):
+        * svg/SVGFitToViewBox.h:
+        * svg/SVGMarkerElement.cpp:
+        (WebCore::SVGMarkerElement::SVGMarkerElement):
+        (WebCore::SVGMarkerElement::viewBoxToViewTransform):
+        * svg/SVGMarkerElement.h:
+        * svg/SVGPatternElement.cpp:
+        (WebCore::SVGPatternElement::SVGPatternElement):
+        (WebCore::SVGPatternElement::buildPattern):
+        * svg/SVGPatternElement.h:
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::SVGSVGElement):
+        (WebCore::SVGSVGElement::viewBoxToViewTransform):
+        * svg/SVGSVGElement.h:
+        * svg/SVGSymbolElement.cpp:
+        (WebCore::SVGSymbolElement::SVGSymbolElement):
+        * svg/SVGSymbolElement.h:
+        * svg/SVGViewElement.cpp:
+        (WebCore::SVGViewElement::SVGViewElement):
+        * svg/SVGViewElement.h:
+        * svg/SVGViewSpec.cpp:
+        (WebCore::SVGViewSpec::SVGViewSpec):
+        * svg/SVGViewSpec.h:
+
 2009-10-08  Brian Weinstein  <bweinstein at apple.com>
 
         Reviewed by Jon Honeycutt.
diff --git a/WebCore/svg/SVGFitToViewBox.cpp b/WebCore/svg/SVGFitToViewBox.cpp
index 847038c..a805248 100644
--- a/WebCore/svg/SVGFitToViewBox.cpp
+++ b/WebCore/svg/SVGFitToViewBox.cpp
@@ -39,8 +39,6 @@ namespace WebCore {
 char SVGFitToViewBoxIdentifier[] = "SVGFitToViewBox";
 
 SVGFitToViewBox::SVGFitToViewBox()
-    : m_viewBox(this, SVGNames::viewBoxAttr)
-    , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())
 {
 }
 
@@ -81,15 +79,13 @@ bool SVGFitToViewBox::parseViewBox(const UChar*& c, const UChar* end, float& x,
     return true;
 }
 
-TransformationMatrix SVGFitToViewBox::viewBoxToViewTransform(float viewWidth, float viewHeight) const
+TransformationMatrix SVGFitToViewBox::viewBoxToViewTransform(const FloatRect& viewBoxRect, SVGPreserveAspectRatio* preserveAspectRatio, float viewWidth, float viewHeight)
 {
-    FloatRect viewBoxRect = viewBox();
+    ASSERT(preserveAspectRatio);
     if (!viewBoxRect.width() || !viewBoxRect.height())
         return TransformationMatrix();
 
-    return preserveAspectRatio()->getCTM(viewBoxRect.x(),
-            viewBoxRect.y(), viewBoxRect.width(), viewBoxRect.height(),
-            0, 0, viewWidth, viewHeight);
+    return preserveAspectRatio->getCTM(viewBoxRect.x(), viewBoxRect.y(), viewBoxRect.width(), viewBoxRect.height(), 0, 0, viewWidth, viewHeight);
 }
 
 bool SVGFitToViewBox::parseMappedAttribute(MappedAttribute* attr)
diff --git a/WebCore/svg/SVGFitToViewBox.h b/WebCore/svg/SVGFitToViewBox.h
index ac03df4..147d207 100644
--- a/WebCore/svg/SVGFitToViewBox.h
+++ b/WebCore/svg/SVGFitToViewBox.h
@@ -39,16 +39,18 @@ namespace WebCore {
         virtual ~SVGFitToViewBox();
 
         bool parseViewBox(const UChar*& start, const UChar* end, float& x, float& y, float& w, float& h, bool validate = true);
-        virtual TransformationMatrix viewBoxToViewTransform(float viewWidth, float viewHeight) const;
+        static TransformationMatrix viewBoxToViewTransform(const FloatRect& viewBoxRect, SVGPreserveAspectRatio*, float viewWidth, float viewHeight);
 
         bool parseMappedAttribute(MappedAttribute*);
         bool isKnownAttribute(const QualifiedName&);
 
         virtual const SVGElement* contextElement() const = 0;
 
-    private:
-        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::viewBoxAttrString, FloatRect, ViewBox, viewBox)
-        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
+    protected:
+        virtual SVGAnimatedTypeValue<FloatRect>::DecoratedType viewBoxBaseValue() const = 0;
+        virtual void setViewBoxBaseValue(SVGAnimatedTypeValue<FloatRect>::DecoratedType type) = 0;
+
+        virtual SVGAnimatedTypeValue<SVGPreserveAspectRatio>::DecoratedType preserveAspectRatioBaseValue() const = 0;
     };
 
 } // namespace WebCore
diff --git a/WebCore/svg/SVGMarkerElement.cpp b/WebCore/svg/SVGMarkerElement.cpp
index bac8f76..60af805 100644
--- a/WebCore/svg/SVGMarkerElement.cpp
+++ b/WebCore/svg/SVGMarkerElement.cpp
@@ -51,6 +51,8 @@ SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* doc)
     , m_orientType(this, SVGNames::orientAttr, SVG_MARKER_ORIENT_ANGLE)
     , m_orientAngle(this, SVGNames::orientAttr, SVGAngle::create())
     , m_externalResourcesRequired(this, SVGNames::externalResourcesRequiredAttr, false)
+    , m_viewBox(this, SVGNames::viewBoxAttr)
+    , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())
 {
     // Spec: If the markerWidth/markerHeight attribute is not specified, the effect is as if a value of "3" were specified.
 }
@@ -64,6 +66,11 @@ SVGMarkerElement::~SVGMarkerElement()
         detach();
 }
 
+TransformationMatrix SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const
+{
+    return SVGFitToViewBox::viewBoxToViewTransform(viewBox(), preserveAspectRatio(), viewWidth, viewHeight);
+}
+
 void SVGMarkerElement::parseMappedAttribute(MappedAttribute* attr)
 {
     if (attr->name() == SVGNames::markerUnitsAttr) {
diff --git a/WebCore/svg/SVGMarkerElement.h b/WebCore/svg/SVGMarkerElement.h
index 250cd0c..a7e37fa 100644
--- a/WebCore/svg/SVGMarkerElement.h
+++ b/WebCore/svg/SVGMarkerElement.h
@@ -58,6 +58,8 @@ namespace WebCore {
         SVGMarkerElement(const QualifiedName&, Document*);
         virtual ~SVGMarkerElement();
 
+        TransformationMatrix viewBoxToViewTransform(float viewWidth, float viewHeight) const;
+
         void setOrientToAuto();
         void setOrientToAngle(PassRefPtr<SVGAngle>);
 
@@ -85,6 +87,10 @@ namespace WebCore {
                                        SVGNames::externalResourcesRequiredAttrString, bool,
                                        ExternalResourcesRequired, externalResourcesRequired)
 
+        // SVGFitToViewBox
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::viewBoxAttrString, FloatRect, ViewBox, viewBox)
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
+ 
         RefPtr<SVGResourceMarker> m_marker;
     };
 
diff --git a/WebCore/svg/SVGPatternElement.cpp b/WebCore/svg/SVGPatternElement.cpp
index 5308229..899451a 100644
--- a/WebCore/svg/SVGPatternElement.cpp
+++ b/WebCore/svg/SVGPatternElement.cpp
@@ -66,6 +66,8 @@ SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Document* doc
     , m_patternTransform(this, SVGNames::patternTransformAttr, SVGTransformList::create(SVGNames::patternTransformAttr))
     , m_href(this, XLinkNames::hrefAttr)
     , m_externalResourcesRequired(this, SVGNames::externalResourcesRequiredAttr, false)
+    , m_viewBox(this, SVGNames::viewBoxAttr)
+    , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())
 {
 }
 
@@ -197,7 +199,7 @@ void SVGPatternElement::buildPattern(const FloatRect& targetRect) const
         }
     }
 
-    TransformationMatrix viewBoxCTM = viewBoxToViewTransform(patternBoundaries.width(), patternBoundaries.height()); 
+    TransformationMatrix viewBoxCTM = viewBoxToViewTransform(viewBox(), preserveAspectRatio(), patternBoundaries.width(), patternBoundaries.height()); 
     FloatRect patternBoundariesIncludingOverflow = patternBoundaries;
 
     // Apply objectBoundingBoxMode fixup for patternContentUnits, if viewBox is not set.
diff --git a/WebCore/svg/SVGPatternElement.h b/WebCore/svg/SVGPatternElement.h
index d341a35..4e10033 100644
--- a/WebCore/svg/SVGPatternElement.h
+++ b/WebCore/svg/SVGPatternElement.h
@@ -78,6 +78,10 @@ namespace WebCore {
                                        SVGNames::externalResourcesRequiredAttrString, bool,
                                        ExternalResourcesRequired, externalResourcesRequired)
 
+        // SVGFitToViewBox
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::viewBoxAttrString, FloatRect, ViewBox, viewBox)
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
+ 
         mutable RefPtr<SVGPaintServerPattern> m_resource;
 
     private:
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index bdf16c8..336e758 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -68,6 +68,8 @@ SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc)
     , m_width(this, SVGNames::widthAttr, LengthModeWidth, "100%")
     , m_height(this, SVGNames::heightAttr, LengthModeHeight, "100%") 
     , m_externalResourcesRequired(this, SVGNames::externalResourcesRequiredAttr, false)
+    , m_viewBox(this, SVGNames::viewBoxAttr)
+    , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())
     , m_useCurrentView(false)
     , m_timeContainer(SMILTimeContainer::create(this))
     , m_viewSpec(0)
@@ -514,13 +516,8 @@ TransformationMatrix SVGSVGElement::viewBoxToViewTransform(float viewWidth, floa
             viewBoxRect = currentView()->viewBox();
     } else
         viewBoxRect = viewBox();
-    if (!viewBoxRect.width() || !viewBoxRect.height())
-        return TransformationMatrix();
-
-    TransformationMatrix ctm = preserveAspectRatio()->getCTM(viewBoxRect.x(),
-            viewBoxRect.y(), viewBoxRect.width(), viewBoxRect.height(),
-            0, 0, viewWidth, viewHeight);
 
+    TransformationMatrix ctm = SVGFitToViewBox::viewBoxToViewTransform(viewBoxRect, preserveAspectRatio(), viewWidth, viewHeight);
     if (useCurrentView() && currentView())
         return currentView()->transform()->concatenate().matrix() * ctm;
 
diff --git a/WebCore/svg/SVGSVGElement.h b/WebCore/svg/SVGSVGElement.h
index b3f1709..54f1903 100644
--- a/WebCore/svg/SVGSVGElement.h
+++ b/WebCore/svg/SVGSVGElement.h
@@ -128,7 +128,7 @@ namespace WebCore {
 
         virtual void svgAttributeChanged(const QualifiedName&);
 
-        virtual TransformationMatrix viewBoxToViewTransform(float viewWidth, float viewHeight) const;
+        TransformationMatrix viewBoxToViewTransform(float viewWidth, float viewHeight) const;
 
         void inheritViewAttributes(SVGViewElement*);
 
@@ -153,6 +153,10 @@ namespace WebCore {
                                        SVGNames::externalResourcesRequiredAttrString, bool,
                                        ExternalResourcesRequired, externalResourcesRequired)
 
+        // SVGFitToViewBox
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::viewBoxAttrString, FloatRect, ViewBox, viewBox)
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
+ 
         virtual void documentWillBecomeInactive();
         virtual void documentDidBecomeActive();
 
diff --git a/WebCore/svg/SVGSymbolElement.cpp b/WebCore/svg/SVGSymbolElement.cpp
index 03a2d95..2ffae77 100644
--- a/WebCore/svg/SVGSymbolElement.cpp
+++ b/WebCore/svg/SVGSymbolElement.cpp
@@ -35,6 +35,8 @@ SVGSymbolElement::SVGSymbolElement(const QualifiedName& tagName, Document* doc)
     , SVGExternalResourcesRequired()
     , SVGFitToViewBox()
     , m_externalResourcesRequired(this, SVGNames::externalResourcesRequiredAttr, false)
+    , m_viewBox(this, SVGNames::viewBoxAttr)
+    , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())
 {
 }
 
diff --git a/WebCore/svg/SVGSymbolElement.h b/WebCore/svg/SVGSymbolElement.h
index 9546e63..7e9659a 100644
--- a/WebCore/svg/SVGSymbolElement.h
+++ b/WebCore/svg/SVGSymbolElement.h
@@ -53,6 +53,9 @@ namespace WebCore {
                                        SVGNames::externalResourcesRequiredAttrString, bool,
                                        ExternalResourcesRequired, externalResourcesRequired)
  
+        // SVGFitToViewBox
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::viewBoxAttrString, FloatRect, ViewBox, viewBox)
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 
     };
 
 } // namespace WebCore
diff --git a/WebCore/svg/SVGViewElement.cpp b/WebCore/svg/SVGViewElement.cpp
index 57e6c9a..dca6d97 100644
--- a/WebCore/svg/SVGViewElement.cpp
+++ b/WebCore/svg/SVGViewElement.cpp
@@ -41,6 +41,8 @@ SVGViewElement::SVGViewElement(const QualifiedName& tagName, Document* doc)
     , SVGFitToViewBox()
     , SVGZoomAndPan()
     , m_externalResourcesRequired(this, SVGNames::externalResourcesRequiredAttr, false)
+    , m_viewBox(this, SVGNames::viewBoxAttr)
+    , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())
 {
 }
 
diff --git a/WebCore/svg/SVGViewElement.h b/WebCore/svg/SVGViewElement.h
index 053dffb..5838859 100644
--- a/WebCore/svg/SVGViewElement.h
+++ b/WebCore/svg/SVGViewElement.h
@@ -55,6 +55,10 @@ namespace WebCore {
                                        SVGNames::externalResourcesRequiredAttrString, bool,
                                        ExternalResourcesRequired, externalResourcesRequired)
  
+        // SVGFitToViewBox
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::viewBoxAttrString, FloatRect, ViewBox, viewBox)
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
+ 
         mutable RefPtr<SVGStringList> m_viewTarget;
     };
 
diff --git a/WebCore/svg/SVGViewSpec.cpp b/WebCore/svg/SVGViewSpec.cpp
index b12b1c2..044a24e 100644
--- a/WebCore/svg/SVGViewSpec.cpp
+++ b/WebCore/svg/SVGViewSpec.cpp
@@ -36,6 +36,8 @@ namespace WebCore {
 SVGViewSpec::SVGViewSpec(const SVGSVGElement* contextElement)
     : SVGFitToViewBox()
     , SVGZoomAndPan()
+    , m_viewBox(this, SVGNames::viewBoxAttr)
+    , m_preserveAspectRatio(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create())
     , m_transform(SVGTransformList::create(SVGNames::transformAttr))
     , m_contextElement(contextElement)
 {
diff --git a/WebCore/svg/SVGViewSpec.h b/WebCore/svg/SVGViewSpec.h
index 8624089..39a697f 100644
--- a/WebCore/svg/SVGViewSpec.h
+++ b/WebCore/svg/SVGViewSpec.h
@@ -56,6 +56,10 @@ namespace WebCore {
         virtual const SVGElement* contextElement() const;
 
     private:
+        // SVGFitToViewBox
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::viewBoxAttrString, FloatRect, ViewBox, viewBox)
+        ANIMATED_PROPERTY_DECLARATIONS(SVGFitToViewBox, SVGFitToViewBoxIdentifier, SVGNames::preserveAspectRatioAttrString, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio)
+ 
         mutable RefPtr<SVGTransformList> m_transform;
         const SVGSVGElement* m_contextElement;
         String m_viewTargetString;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list