Reviewed by Eric.
authorzimmermann <zimmermann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jan 2007 14:03:41 +0000 (14:03 +0000)
committerzimmermann <zimmermann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jan 2007 14:03:41 +0000 (14:03 +0000)
Rewrite <use> support with a real-shadow tree (as the spec demands), and implement SVGElementInstance.
AFAIK we're the first implementing this SVG feature - after ASV3 (!).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18979 268f45cc-cd09-0410-ab3c-d52691b4dbfc

75 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/W3C-SVG-1.1/text-text-04-t-expected.png
LayoutTests/svg/W3C-SVG-1.1/text-text-04-t-expected.txt
LayoutTests/svg/carto.net/button-expected.png
LayoutTests/svg/carto.net/button-expected.txt
LayoutTests/svg/carto.net/colourpicker-expected.png
LayoutTests/svg/carto.net/colourpicker-expected.txt
LayoutTests/svg/carto.net/slider-expected.png
LayoutTests/svg/carto.net/slider-expected.txt
LayoutTests/svg/carto.net/window-expected.png
LayoutTests/svg/carto.net/window-expected.txt
LayoutTests/svg/custom/use-forward-refs-expected.png
LayoutTests/svg/custom/use-forward-refs-expected.txt
LayoutTests/svg/custom/use-instanceRoot-modifications-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/use-instanceRoot-modifications-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/use-instanceRoot-modifications-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/use-instanceRoot-modifications.svg [new file with mode: 0644]
LayoutTests/svg/custom/use-on-g-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/use-on-g-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/use-on-g-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/use-on-g.svg [new file with mode: 0644]
LayoutTests/svg/custom/use-on-rect-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/use-on-rect-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/use-on-rect-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/use-on-rect.svg [new file with mode: 0644]
LayoutTests/svg/custom/use-on-symbol-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/use-on-symbol-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/use-on-symbol-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/use-on-symbol-inside-pattern.svg [new file with mode: 0644]
LayoutTests/svg/custom/use-on-symbol.svg [new file with mode: 0644]
LayoutTests/svg/custom/use-on-text-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/use-on-text-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/use-on-text-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/use-on-text.svg [new file with mode: 0644]
LayoutTests/svg/custom/use-transform-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/use-transform-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/use-transform-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/use-transform.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/DerivedSources.make
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bindings/objc/DOMInternal.h
WebCore/bindings/objc/DOMSVG.h
WebCore/ksvg2/misc/SVGDocumentExtensions.cpp
WebCore/ksvg2/misc/SVGDocumentExtensions.h
WebCore/ksvg2/svg/SVGCircleElement.cpp
WebCore/ksvg2/svg/SVGElement.cpp
WebCore/ksvg2/svg/SVGElement.h
WebCore/ksvg2/svg/SVGElementInstance.cpp
WebCore/ksvg2/svg/SVGElementInstance.h
WebCore/ksvg2/svg/SVGElementInstance.idl [new file with mode: 0644]
WebCore/ksvg2/svg/SVGElementInstanceList.cpp
WebCore/ksvg2/svg/SVGElementInstanceList.h
WebCore/ksvg2/svg/SVGElementInstanceList.idl [new file with mode: 0644]
WebCore/ksvg2/svg/SVGEllipseElement.cpp
WebCore/ksvg2/svg/SVGGElement.cpp
WebCore/ksvg2/svg/SVGGElement.h
WebCore/ksvg2/svg/SVGGradientElement.cpp
WebCore/ksvg2/svg/SVGGradientElement.h
WebCore/ksvg2/svg/SVGHiddenElement.h [new file with mode: 0644]
WebCore/ksvg2/svg/SVGImageElement.cpp
WebCore/ksvg2/svg/SVGLineElement.cpp
WebCore/ksvg2/svg/SVGPathElement.cpp
WebCore/ksvg2/svg/SVGPatternElement.cpp
WebCore/ksvg2/svg/SVGPatternElement.h
WebCore/ksvg2/svg/SVGPolyElement.cpp
WebCore/ksvg2/svg/SVGRectElement.cpp
WebCore/ksvg2/svg/SVGStyledElement.cpp
WebCore/ksvg2/svg/SVGStyledElement.h
WebCore/ksvg2/svg/SVGUseElement.cpp
WebCore/ksvg2/svg/SVGUseElement.h
WebCore/ksvg2/svg/SVGUseElement.idl

index ee72575..5134ebd 100644 (file)
@@ -1,3 +1,50 @@
+2007-01-19  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Eric.
+
+        Update svg baseline after <use> rewrite.
+
+        * svg/W3C-SVG-1.1/text-text-04-t-expected.png:
+        * svg/W3C-SVG-1.1/text-text-04-t-expected.txt:
+        * svg/carto.net/button-expected.png:
+        * svg/carto.net/button-expected.txt:
+        * svg/carto.net/colourpicker-expected.png:
+        * svg/carto.net/colourpicker-expected.txt:
+        * svg/carto.net/slider-expected.png:
+        * svg/carto.net/slider-expected.txt:
+        * svg/carto.net/window-expected.png:
+        * svg/carto.net/window-expected.txt:
+        * svg/custom/use-forward-refs-expected.png:
+        * svg/custom/use-forward-refs-expected.txt:
+        * svg/custom/use-instanceRoot-modifications-expected.checksum: Added.
+        * svg/custom/use-instanceRoot-modifications-expected.png: Added.
+        * svg/custom/use-instanceRoot-modifications-expected.txt: Added.
+        * svg/custom/use-instanceRoot-modifications.svg: Added.
+        * svg/custom/use-on-g-expected.checksum: Added.
+        * svg/custom/use-on-g-expected.png: Added.
+        * svg/custom/use-on-g-expected.txt: Added.
+        * svg/custom/use-on-g.svg: Added.
+        * svg/custom/use-on-rect-expected.checksum: Added.
+        * svg/custom/use-on-rect-expected.png: Added.
+        * svg/custom/use-on-rect-expected.txt: Added.
+        * svg/custom/use-on-rect.svg: Added.
+        * svg/custom/use-on-symbol-expected.checksum: Added.
+        * svg/custom/use-on-symbol-expected.png: Added.
+        * svg/custom/use-on-symbol-expected.txt: Added.
+        * svg/custom/use-on-symbol-inside-pattern-expected.checksum: Added.
+        * svg/custom/use-on-symbol-inside-pattern-expected.png: Added.
+        * svg/custom/use-on-symbol-inside-pattern-expected.txt: Added.
+        * svg/custom/use-on-symbol-inside-pattern.svg: Added.
+        * svg/custom/use-on-symbol.svg: Added.
+        * svg/custom/use-on-text-expected.checksum: Added.
+        * svg/custom/use-on-text-expected.png: Added.
+        * svg/custom/use-on-text-expected.txt: Added.
+        * svg/custom/use-on-text.svg: Added.
+        * svg/custom/use-transform-expected.checksum: Added.
+        * svg/custom/use-transform-expected.png: Added.
+        * svg/custom/use-transform-expected.txt: Added.
+        * svg/custom/use-transform.svg: Added.
+
 2007-01-18  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Maciej.
index 44a2cc4..0e5517f 100644 (file)
Binary files a/LayoutTests/svg/W3C-SVG-1.1/text-text-04-t-expected.png and b/LayoutTests/svg/W3C-SVG-1.1/text-text-04-t-expected.png differ
index de0f959..d00c98d 100644 (file)
@@ -3,15 +3,23 @@ layer at (0,0) size 480x360
     RenderSVGContainer {svg} at (-4,-4) size 483.50x363.50
       RenderSVGContainer {defs} at (0,0) size 0x0
       RenderSVGContainer {g} at (-4,-4) size 458x313
-        RenderSVGContainer {g} at (36,22) size 134x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(130.00,40.00)}]
+        RenderSVGContainer {g} at (36,22) size 143x23 [transform={m=((1.00,0.00)(0.00,1.00)) t=(130.00,40.00)}]
           RenderSVGText {text} at (-30,0) size 480x18
             RenderSVGInlineText {#text} at (-64,-14) size 64x18
               text run at (-64,-14) width 64: "Reference"
-          RenderSVGContainer {g} at (130,22) size 40x23
-            RenderSVGContainer {use} at (130,40) size 0x0
-            RenderSVGContainer {use} at (130,40) size 0x0
-            RenderSVGContainer {use} at (130,40) size 0x0
-            RenderSVGContainer {use} at (130,40) size 0x0
+          RenderSVGContainer {g} at (126,22) size 53x23
+            RenderSVGContainer {use} at (126,36) size 8x8
+              RenderSVGContainer {g} at (126,36) size 8x8
+                RenderPath {rect} at (126,36) size 8x8 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"]
+            RenderSVGContainer {use} at (141,36) size 8x8
+              RenderSVGContainer {g} at (141,36) size 8x8 [transform={m=((1.00,0.00)(0.00,1.00)) t=(15.00,0.00)}]
+                RenderPath {rect} at (141,36) size 8x8 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"]
+            RenderSVGContainer {use} at (156,36) size 8x8
+              RenderSVGContainer {g} at (156,36) size 8x8 [transform={m=((1.00,0.00)(0.00,1.00)) t=(30.00,0.00)}]
+                RenderPath {rect} at (156,36) size 8x8 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"]
+            RenderSVGContainer {use} at (171,36) size 8x8
+              RenderSVGContainer {g} at (171,36) size 8x8 [transform={m=((1.00,0.00)(0.00,1.00)) t=(45.00,0.00)}]
+                RenderPath {rect} at (171,36) size 8x8 [fill={[type=SOLID] [color=#8888FF]}] [data="M-4.00,-4.00L4.00,-4.00L4.00,4.00L-4.00,4.00"]
             RenderSVGText {text} at (0,0) size 480x23
               RenderSVGInlineText {#text} at (0,-18) size 40x23
                 text run at (0,-18) width 40: "1234"
index 57a3843..7d1ac35 100644 (file)
Binary files a/LayoutTests/svg/carto.net/button-expected.png and b/LayoutTests/svg/carto.net/button-expected.png differ
index eb7c67e..49250fa 100644 (file)
@@ -71,12 +71,22 @@ layer at (0,0) size 800x600
           RenderPath {rect} at (233.59,116.41) size 15.62x15.62 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M299.00,149.00L319.00,149.00L319.00,169.00L299.00,169.00"]
           RenderPath {rect} at (235.16,117.97) size 15.62x15.62 [fill={[type=SOLID] [color=#000080]}] [data="M301.00,151.00L321.00,151.00L321.00,171.00L301.00,171.00"]
           RenderPath {rect} at (234.38,117.19) size 15.62x15.62 [fill={[type=SOLID] [color=#B0C4DE]}] [data="M300.00,150.00L320.00,150.00L320.00,170.00L300.00,170.00"]
-          RenderSVGContainer {use} at (0,0) size 0x0
+          RenderSVGContainer {use} at (238.77,117.07) size 8.70x15.10
+            RenderSVGContainer {g} at (238.77,117.07) size 8.70x15.10 [transform={m=((1.00,0.00)(0.00,1.00)) t=(310.00,160.00)}]
+              RenderSVGContainer {svg} at (238.77,117.07) size 8.70x15.10
+                RenderSVGContainer {g} at (238.77,117.07) size 8.70x15.10 [transform={m=((1.25,0.00)(0.00,1.25)) t=(0.00,0.00)}]
+                  RenderPath {line} at (241.40,124.66) size 4.50x7.51 [stroke={[type=SOLID] [color=#000000] [stroke width=1.75]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00L3.00,7.00"]
+                  RenderPath {path} at (238.77,117.07) size 8.70x12.04 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFFFFF] [fill rule=EVEN-ODD]}] [data="M-3.00,-7.00L-3.00,3.00L0.00,0.00L4.25,-0.50"]
         RenderSVGContainer {g} at (272.66,112.50) size 21.09x21.09
           RenderPath {ellipse} at (272.66,112.50) size 19.53x19.53 [fill={[type=SOLID] [color=#FFFFFF]}] [data="M374.00,156.50L373.98,157.28L373.90,158.07L373.78,158.84L373.61,159.61L373.39,160.36L373.12,161.10L372.81,161.82L372.45,162.52L372.05,163.20L371.61,163.85L371.13,164.47L370.61,165.06L370.06,165.61L369.47,166.13L368.85,166.61L368.20,167.05L367.52,167.45L366.82,167.81L366.10,168.12L365.36,168.39L364.61,168.61L363.84,168.78L363.07,168.90L362.28,168.98L361.50,169.00L360.72,168.98L359.93,168.90L359.16,168.78L358.39,168.61L357.64,168.39L356.90,168.12L356.18,167.81L355.48,167.45L354.80,167.05L354.15,166.61L353.53,166.13L352.94,165.61L352.39,165.06L351.87,164.47L351.39,163.85L350.95,163.20L350.55,162.52L350.19,161.82L349.88,161.10L349.61,160.36L349.39,159.61L349.22,158.84L349.10,158.07L349.02,157.28L349.00,156.50L349.02,155.72L349.10,154.93L349.22,154.16L349.39,153.39L349.61,152.64L349.88,151.90L350.19,151.18L350.55,150.48L350.95,149.80L351.39,149.15L351.87,148.53L352.39,147.94L352.94,147.39L353.53,146.87L354.15,146.39L354.80,145.95L355.48,145.55L356.18,145.19L356.90,144.88L357.64,144.61L358.39,144.39L359.16,144.22L359.93,144.10L360.72,144.02L361.50,144.00L362.28,144.02L363.07,144.10L363.84,144.22L364.61,144.39L365.36,144.61L366.10,144.88L366.82,145.19L367.52,145.55L368.20,145.95L368.85,146.39L369.47,146.87L370.06,147.39L370.61,147.94L371.13,148.53L371.61,149.15L372.05,149.80L372.45,150.48L372.81,151.18L373.12,151.90L373.39,152.64L373.61,153.39L373.78,154.16L373.90,154.93L373.98,155.72"]
           RenderPath {ellipse} at (274.22,114.06) size 19.53x19.53 [fill={[type=SOLID] [color=#000080]}] [data="M376.00,158.50L375.98,159.28L375.90,160.07L375.78,160.84L375.61,161.61L375.39,162.36L375.12,163.10L374.81,163.82L374.45,164.52L374.05,165.20L373.61,165.85L373.13,166.47L372.61,167.06L372.06,167.61L371.47,168.13L370.85,168.61L370.20,169.05L369.52,169.45L368.82,169.81L368.10,170.12L367.36,170.39L366.61,170.61L365.84,170.78L365.07,170.90L364.28,170.98L363.50,171.00L362.72,170.98L361.93,170.90L361.16,170.78L360.39,170.61L359.64,170.39L358.90,170.12L358.18,169.81L357.48,169.45L356.80,169.05L356.15,168.61L355.53,168.13L354.94,167.61L354.39,167.06L353.87,166.47L353.39,165.85L352.95,165.20L352.55,164.52L352.19,163.82L351.88,163.10L351.61,162.36L351.39,161.61L351.22,160.84L351.10,160.07L351.02,159.28L351.00,158.50L351.02,157.72L351.10,156.93L351.22,156.16L351.39,155.39L351.61,154.64L351.88,153.90L352.19,153.18L352.55,152.48L352.95,151.80L353.39,151.15L353.87,150.53L354.39,149.94L354.94,149.39L355.53,148.87L356.15,148.39L356.80,147.95L357.48,147.55L358.18,147.19L358.90,146.88L359.64,146.61L360.39,146.39L361.16,146.22L361.93,146.10L362.72,146.02L363.50,146.00L364.28,146.02L365.07,146.10L365.84,146.22L366.61,146.39L367.36,146.61L368.10,146.88L368.82,147.19L369.52,147.55L370.20,147.95L370.85,148.39L371.47,148.87L372.06,149.39L372.61,149.94L373.13,150.53L373.61,151.15L374.05,151.80L374.45,152.48L374.81,153.18L375.12,153.90L375.39,154.64L375.61,155.39L375.78,156.16L375.90,156.93L375.98,157.72"]
           RenderPath {ellipse} at (273.44,113.28) size 19.53x19.53 [fill={[type=SOLID] [color=#B0C4DE]}] [data="M375.00,157.50L374.98,158.28L374.90,159.07L374.78,159.84L374.61,160.61L374.39,161.36L374.12,162.10L373.81,162.82L373.45,163.52L373.05,164.20L372.61,164.85L372.13,165.47L371.61,166.06L371.06,166.61L370.47,167.13L369.85,167.61L369.20,168.05L368.52,168.45L367.82,168.81L367.10,169.12L366.36,169.39L365.61,169.61L364.84,169.78L364.07,169.90L363.28,169.98L362.50,170.00L361.72,169.98L360.93,169.90L360.16,169.78L359.39,169.61L358.64,169.39L357.90,169.12L357.18,168.81L356.48,168.45L355.80,168.05L355.15,167.61L354.53,167.13L353.94,166.61L353.39,166.06L352.87,165.47L352.39,164.85L351.95,164.20L351.55,163.52L351.19,162.82L350.88,162.10L350.61,161.36L350.39,160.61L350.22,159.84L350.10,159.07L350.02,158.28L350.00,157.50L350.02,156.72L350.10,155.93L350.22,155.16L350.39,154.39L350.61,153.64L350.88,152.90L351.19,152.18L351.55,151.48L351.95,150.80L352.39,150.15L352.87,149.53L353.39,148.94L353.94,148.39L354.53,147.87L355.15,147.39L355.80,146.95L356.48,146.55L357.18,146.19L357.90,145.88L358.64,145.61L359.39,145.39L360.16,145.22L360.93,145.10L361.72,145.02L362.50,145.00L363.28,145.02L364.07,145.10L364.84,145.22L365.61,145.39L366.36,145.61L367.10,145.88L367.82,146.19L368.52,146.55L369.20,146.95L369.85,147.39L370.47,147.87L371.06,148.39L371.61,148.94L372.13,149.53L372.61,150.15L373.05,150.80L373.45,151.48L373.81,152.18L374.12,152.90L374.39,153.64L374.61,154.39L374.78,155.16L374.90,155.93L374.98,156.72"]
-          RenderSVGContainer {use} at (0,0) size 0x0
+          RenderSVGContainer {use} at (279.79,115.12) size 8.70x15.10
+            RenderSVGContainer {g} at (279.79,115.12) size 8.70x15.10 [transform={m=((1.00,0.00)(0.00,1.00)) t=(362.50,157.50)}]
+              RenderSVGContainer {svg} at (279.79,115.12) size 8.70x15.10
+                RenderSVGContainer {g} at (279.79,115.12) size 8.70x15.10 [transform={m=((1.25,0.00)(0.00,1.25)) t=(0.00,0.00)}]
+                  RenderPath {line} at (282.42,122.71) size 4.50x7.51 [stroke={[type=SOLID] [color=#000000] [stroke width=1.75]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00L3.00,7.00"]
+                  RenderPath {path} at (279.79,115.12) size 8.70x12.04 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#FFFFFF] [fill rule=EVEN-ODD]}] [data="M-3.00,-7.00L-3.00,3.00L0.00,0.00L4.25,-0.50"]
       RenderSVGText {text} at (100,210) size 800x18
         RenderSVGInlineText {#text} at (0,-14) size 67x18
           text run at (0,-14) width 67: "StatusText"
index aab744f..51ce8a4 100644 (file)
Binary files a/LayoutTests/svg/carto.net/colourpicker-expected.png and b/LayoutTests/svg/carto.net/colourpicker-expected.png differ
index e15a04a..cc524d9 100644 (file)
@@ -23,7 +23,10 @@ layer at (0,0) size 800x600
           RenderPath {rect} at (165.62,321.76) size 154.69x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FF0000), (0.17,#FFFF00), (0.33,#00FF00), (0.50,#00FFFF), (0.67,#0000FF), (0.83,#FF00FF), (1.00,#FF0000)]] [start=(0,0)] [end=(1,0)]}] [data="M212.00,411.85L410.00,411.85L410.00,419.35L212.00,419.35"]
           RenderPath {line} at (159.77,318.83) size 166.41x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M212.00,415.60L410.00,415.60"]
           RenderPath {line} at (165.62,324.69) size 154.69x0 [data="M212.00,415.60L410.00,415.60"]
-          RenderSVGContainer {use} at (217.19,324.69) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(278.00,415.60)}]
+          RenderSVGContainer {use} at (215.23,316.88) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(278.00,415.60)}]
+            RenderSVGContainer {g} at (215.23,316.88) size 3.91x15.62
+              RenderSVGContainer {svg} at (215.23,316.88) size 3.91x15.62
+                RenderPath {line} at (215.23,316.88) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (416,420) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 76x14
               text run at (0,-11) width 76: "Hue (0\x{B0}-360\x{B0})"
@@ -32,21 +35,30 @@ layer at (0,0) size 800x600
           RenderPath {rect} at (235.94,340.51) size 84.38x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FFFFFF), (1.00,#00FF00)]] [start=(0,0)] [end=(1,0)]}] [data="M302.00,435.85L410.00,435.85L410.00,443.35L302.00,443.35"]
           RenderPath {line} at (230.08,337.58) size 96.09x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M302.00,439.60L410.00,439.60"]
           RenderPath {line} at (235.94,343.44) size 84.38x0 [data="M302.00,439.60L410.00,439.60"]
-          RenderSVGContainer {use} at (320.31,343.44) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(410.00,439.60)}]
+          RenderSVGContainer {use} at (318.36,335.62) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(410.00,439.60)}]
+            RenderSVGContainer {g} at (318.36,335.62) size 3.91x15.62
+              RenderSVGContainer {svg} at (318.36,335.62) size 3.91x15.62
+                RenderPath {line} at (318.36,335.62) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (416,444) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 78x14
               text run at (0,-11) width 78: "Saturation (%)"
           RenderPath {rect} at (235.94,359.26) size 84.38x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#000000), (1.00,#00FF00)]] [start=(0,0)] [end=(1,0)]}] [data="M302.00,459.85L410.00,459.85L410.00,467.35L302.00,467.35"]
           RenderPath {line} at (230.08,356.33) size 96.09x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M302.00,463.60L410.00,463.60"]
           RenderPath {line} at (235.94,362.19) size 84.38x0 [data="M302.00,463.60L410.00,463.60"]
-          RenderSVGContainer {use} at (320.31,362.19) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(410.00,463.60)}]
+          RenderSVGContainer {use} at (318.36,354.38) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(410.00,463.60)}]
+            RenderSVGContainer {g} at (318.36,354.38) size 3.91x15.62
+              RenderSVGContainer {svg} at (318.36,354.38) size 3.91x15.62
+                RenderPath {line} at (318.36,354.38) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (416,468) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 54x14
               text run at (0,-11) width 54: "Value (%)"
           RenderPath {rect} at (235.94,378.01) size 84.38x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#00FF0000), (1.00,#00FF00)]] [start=(0,0)] [end=(1,0)]}] [data="M302.00,483.85L410.00,483.85L410.00,491.35L302.00,491.35"]
           RenderPath {line} at (230.08,375.08) size 96.09x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M302.00,487.60L410.00,487.60"]
           RenderPath {line} at (235.94,380.94) size 84.38x0 [data="M302.00,487.60L410.00,487.60"]
-          RenderSVGContainer {use} at (320.31,380.94) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(410.00,487.60)}]
+          RenderSVGContainer {use} at (318.36,373.12) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(410.00,487.60)}]
+            RenderSVGContainer {g} at (318.36,373.12) size 3.91x15.62
+              RenderSVGContainer {svg} at (318.36,373.12) size 3.91x15.62
+                RenderPath {line} at (318.36,373.12) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (416,492) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 63x14
               text run at (0,-11) width 63: "Opacity (%)"
@@ -58,7 +70,10 @@ layer at (0,0) size 800x600
           RenderPath {rect} at (400,163.48) size 154.69x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FF0000), (0.17,#FF8000), (0.33,#FFFF00), (0.50,#80FF00), (0.67,#00FF00), (0.83,#00FF80), (1.00,#00FFFF)]] [start=(0,0)] [end=(1,0)]}] [data="M512.00,209.25L710.00,209.25L710.00,216.75L512.00,216.75"]
           RenderPath {line} at (394.14,160.55) size 166.41x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M512.00,213.00L710.00,213.00"]
           RenderPath {line} at (400,166.41) size 154.69x0 [data="M512.00,213.00L710.00,213.00"]
-          RenderSVGContainer {use} at (400,166.41) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(512.00,213.00)}]
+          RenderSVGContainer {use} at (398.05,158.59) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(512.00,213.00)}]
+            RenderSVGContainer {g} at (398.05,158.59) size 3.91x15.62
+              RenderSVGContainer {svg} at (398.05,158.59) size 3.91x15.62
+                RenderPath {line} at (398.05,158.59) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (716,217) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 76x14
               text run at (0,-11) width 76: "Hue (0\x{B0}-180\x{B0})"
@@ -67,14 +82,20 @@ layer at (0,0) size 800x600
           RenderPath {rect} at (470.31,184.31) size 84.38x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FFFFFF), (1.00,#FF0000)]] [start=(0,0)] [end=(1,0)]}] [data="M602.00,235.92L710.00,235.92L710.00,243.42L602.00,243.42"]
           RenderPath {line} at (464.45,181.38) size 96.09x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M602.00,239.67L710.00,239.67"]
           RenderPath {line} at (470.31,187.24) size 84.38x0 [data="M602.00,239.67L710.00,239.67"]
-          RenderSVGContainer {use} at (554.69,187.24) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(710.00,239.67)}]
+          RenderSVGContainer {use} at (552.73,179.43) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(710.00,239.67)}]
+            RenderSVGContainer {g} at (552.73,179.43) size 3.91x15.62
+              RenderSVGContainer {svg} at (552.73,179.43) size 3.91x15.62
+                RenderPath {line} at (552.73,179.43) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (716,244) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 78x14
               text run at (0,-11) width 78: "Saturation (%)"
           RenderPath {rect} at (470.31,205.14) size 84.38x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#000000), (1.00,#FF0000)]] [start=(0,0)] [end=(1,0)]}] [data="M602.00,262.58L710.00,262.58L710.00,270.08L602.00,270.08"]
           RenderPath {line} at (464.45,202.21) size 96.09x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M602.00,266.33L710.00,266.33"]
           RenderPath {line} at (470.31,208.07) size 84.38x0 [data="M602.00,266.33L710.00,266.33"]
-          RenderSVGContainer {use} at (554.69,208.07) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(710.00,266.33)}]
+          RenderSVGContainer {use} at (552.73,200.26) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(710.00,266.33)}]
+            RenderSVGContainer {g} at (552.73,200.26) size 3.91x15.62
+              RenderSVGContainer {svg} at (552.73,200.26) size 3.91x15.62
+                RenderPath {line} at (552.73,200.26) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (716,270) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 54x14
               text run at (0,-11) width 54: "Value (%)"
@@ -86,7 +107,10 @@ layer at (0,0) size 800x600
           RenderPath {rect} at (556.25,399.88) size 154.69x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FF0000), (0.17,#FFFF00), (0.33,#00FF00), (0.50,#00FFFF), (0.67,#0000FF), (0.83,#FF00FF), (1.00,#FF0000)]] [start=(0,0)] [end=(1,0)]}] [data="M712.00,511.85L910.00,511.85L910.00,519.35L712.00,519.35"]
           RenderPath {line} at (550.39,396.95) size 166.41x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M712.00,515.60L910.00,515.60"]
           RenderPath {line} at (556.25,402.81) size 154.69x0 [data="M712.00,515.60L910.00,515.60"]
-          RenderSVGContainer {use} at (556.25,402.81) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(712.00,515.60)}]
+          RenderSVGContainer {use} at (554.30,395.00) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(712.00,515.60)}]
+            RenderSVGContainer {g} at (554.30,395.00) size 3.91x15.62
+              RenderSVGContainer {svg} at (554.30,395.00) size 3.91x15.62
+                RenderPath {line} at (554.30,395.00) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (916,520) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 76x14
               text run at (0,-11) width 76: "Hue (0\x{B0}-360\x{B0})"
@@ -94,21 +118,30 @@ layer at (0,0) size 800x600
           RenderPath {rect} at (603.12,418.63) size 107.81x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#787878), (1.00,#780000)]] [start=(0,0)] [end=(1,0)]}] [data="M772.00,535.85L910.00,535.85L910.00,543.35L772.00,543.35"]
           RenderPath {line} at (597.27,415.70) size 119.53x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M772.00,539.60L910.00,539.60"]
           RenderPath {line} at (603.12,421.56) size 107.81x0 [data="M772.00,539.60L910.00,539.60"]
-          RenderSVGContainer {use} at (603.12,421.56) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(772.00,539.60)}]
+          RenderSVGContainer {use} at (601.17,413.75) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(772.00,539.60)}]
+            RenderSVGContainer {g} at (601.17,413.75) size 3.91x15.62
+              RenderSVGContainer {svg} at (601.17,413.75) size 3.91x15.62
+                RenderPath {line} at (601.17,413.75) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (916,544) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 78x14
               text run at (0,-11) width 78: "Saturation (%)"
           RenderPath {rect} at (603.12,437.38) size 107.81x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#000000), (1.00,#FFFFFF)]] [start=(0,0)] [end=(1,0)]}] [data="M772.00,559.85L910.00,559.85L910.00,567.35L772.00,567.35"]
           RenderPath {line} at (597.27,434.45) size 119.53x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M772.00,563.60L910.00,563.60"]
           RenderPath {line} at (603.12,440.31) size 107.81x0 [data="M772.00,563.60L910.00,563.60"]
-          RenderSVGContainer {use} at (653.80,440.31) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(836.86,563.60)}]
+          RenderSVGContainer {use} at (651.84,432.50) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(836.86,563.60)}]
+            RenderSVGContainer {g} at (651.84,432.50) size 3.91x15.62
+              RenderSVGContainer {svg} at (651.84,432.50) size 3.91x15.62
+                RenderPath {line} at (651.84,432.50) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (916,568) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 54x14
               text run at (0,-11) width 54: "Value (%)"
           RenderPath {rect} at (603.12,456.13) size 107.81x5.86 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#78787800), (1.00,#787878)]] [start=(0,0)] [end=(1,0)]}] [data="M772.00,583.85L910.00,583.85L910.00,591.35L772.00,591.35"]
           RenderPath {line} at (597.27,453.20) size 119.53x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M772.00,587.60L910.00,587.60"]
           RenderPath {line} at (603.12,459.06) size 107.81x0 [data="M772.00,587.60L910.00,587.60"]
-          RenderSVGContainer {use} at (710.94,459.06) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(910.00,587.60)}]
+          RenderSVGContainer {use} at (708.98,451.25) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(910.00,587.60)}]
+            RenderSVGContainer {g} at (708.98,451.25) size 3.91x15.62
+              RenderSVGContainer {svg} at (708.98,451.25) size 3.91x15.62
+                RenderPath {line} at (708.98,451.25) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (916,592) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 63x14
               text run at (0,-11) width 63: "Opacity (%)"
@@ -128,7 +161,10 @@ layer at (0,0) size 800x600
           RenderPath {rect} at (163.82,85.22) size 113.52x113.52 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#80FF00), (0.20,#00FF00), (0.40,#00FF80), (0.60,#00FFFF), (0.80,#0080FF), (1.00,#0000FF)]] [start=(0,0)] [end=(1,0)]}] [data="M512.00,207.95L710.00,207.95L710.00,215.45L512.00,215.45"]
           RenderPath {line} at (157.61,79.01) size 125.95x125.95 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M512.00,211.70L710.00,211.70"]
           RenderPath {line} at (165.89,87.29) size 109.38x109.38 [data="M512.00,211.70L710.00,211.70"]
-          RenderSVGContainer {use} at (231.52,152.92) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(630.80,211.70)}]
+          RenderSVGContainer {use} at (224.62,146.01) size 13.81x13.81 [transform={m=((1.00,0.00)(0.00,1.00)) t=(630.80,211.70)}]
+            RenderSVGContainer {g} at (224.62,146.01) size 13.81x13.81
+              RenderSVGContainer {svg} at (224.62,146.01) size 13.81x13.81
+                RenderPath {line} at (224.62,146.01) size 13.81x13.81 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (716,216) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 83x14
               text run at (0,-11) width 83: "Hue (90\x{B0}-240\x{B0})"
@@ -136,14 +172,20 @@ layer at (0,0) size 800x600
           RenderPath {rect} at (183.71,131.62) size 80.38x80.38 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#FFFFFF), (1.00,#00FFFF)]] [start=(0,0)] [end=(1,0)]}] [data="M572.00,231.95L710.00,231.95L710.00,239.45L572.00,239.45"]
           RenderPath {line} at (177.49,125.41) size 92.81x92.81 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M572.00,235.70L710.00,235.70"]
           RenderPath {line} at (185.78,133.70) size 76.23x76.23 [data="M572.00,235.70L710.00,235.70"]
-          RenderSVGContainer {use} at (262.02,209.93) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(710.00,235.70)}]
+          RenderSVGContainer {use} at (255.11,203.03) size 13.81x13.81 [transform={m=((1.00,0.00)(0.00,1.00)) t=(710.00,235.70)}]
+            RenderSVGContainer {g} at (255.11,203.03) size 13.81x13.81
+              RenderSVGContainer {svg} at (255.11,203.03) size 13.81x13.81
+                RenderPath {line} at (255.11,203.03) size 13.81x13.81 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (716,240) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 78x14
               text run at (0,-11) width 78: "Saturation (%)"
           RenderPath {rect} at (170.45,144.88) size 80.38x80.38 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#00FFFF00), (1.00,#00FFFF)]] [start=(0,0)] [end=(1,0)]}] [data="M572.00,255.95L710.00,255.95L710.00,263.45L572.00,263.45"]
           RenderPath {line} at (164.24,138.67) size 92.81x92.81 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M572.00,259.70L710.00,259.70"]
           RenderPath {line} at (172.52,146.95) size 76.23x76.23 [data="M572.00,259.70L710.00,259.70"]
-          RenderSVGContainer {use} at (210.64,185.07) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(641.00,259.70)}]
+          RenderSVGContainer {use} at (203.74,178.17) size 13.81x13.81 [transform={m=((1.00,0.00)(0.00,1.00)) t=(641.00,259.70)}]
+            RenderSVGContainer {g} at (203.74,178.17) size 13.81x13.81
+              RenderSVGContainer {svg} at (203.74,178.17) size 13.81x13.81
+                RenderPath {line} at (203.74,178.17) size 13.81x13.81 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
           RenderSVGText {text} at (716,264) size 800x14
             RenderSVGInlineText {#text} at (0,-11) size 63x14
               text run at (0,-11) width 63: "Opacity (%)"
index cd25112..2968d97 100644 (file)
Binary files a/LayoutTests/svg/carto.net/slider-expected.png and b/LayoutTests/svg/carto.net/slider-expected.png differ
index 55da58b..983deb9 100644 (file)
@@ -6,22 +6,34 @@ layer at (0,0) size 800x600
       RenderSVGText {text} at (512,40) size 800x22
         RenderSVGInlineText {#text} at (-254,-18) size 508x22
           text run at (-254,-18) width 508: "Demonstration of the carto.net SVG GUI slider object"
-      RenderSVGContainer {g} at (548.83,44.92) size 11.72x89.84
+      RenderSVGContainer {g} at (546.88,44.92) size 15.62x89.84
         RenderPath {line} at (548.83,44.92) size 11.72x89.84 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M710.00,65.00L710.00,165.00"]
         RenderPath {line} at (553.52,50.78) size 2.34x78.12 [stroke={[type=SOLID] [color=#696969] [stroke width=3.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M710.00,65.00L710.00,165.00"]
-        RenderSVGContainer {use} at (554.69,89.84) size 0x0 [transform={m=((-0.00,1.00)(-1.00,-0.00)) t=(710.00,115.00)}]
+        RenderSVGContainer {use} at (546.88,87.89) size 15.62x3.91 [transform={m=((-0.00,1.00)(-1.00,-0.00)) t=(710.00,115.00)}]
+          RenderSVGContainer {g} at (546.88,87.89) size 15.62x3.91
+            RenderSVGContainer {svg} at (546.88,87.89) size 15.62x3.91
+              RenderPath {line} at (546.88,87.89) size 15.62x3.91 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
       RenderSVGContainer {g} at (69.84,69.84) size 172.82x172.82
         RenderPath {line} at (69.84,69.84) size 172.82x172.82 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M100.00,100.00L300.00,300.00"]
         RenderPath {line} at (77.30,77.30) size 157.91x157.91 [stroke={[type=SOLID] [color=#696969] [stroke width=3.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M100.00,100.00L300.00,300.00"]
-        RenderSVGContainer {use} at (171.88,171.88) size 0x0 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(220.00,220.00)}]
-      RenderSVGContainer {g} at (111.33,72.27) size 89.84x11.72 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,0.00)}]
+        RenderSVGContainer {use} at (164.97,164.97) size 13.81x13.81 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(220.00,220.00)}]
+          RenderSVGContainer {g} at (164.97,164.97) size 13.81x13.81
+            RenderSVGContainer {svg} at (164.97,164.97) size 13.81x13.81
+              RenderPath {line} at (164.97,164.97) size 13.81x13.81 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
+      RenderSVGContainer {g} at (111.33,70.31) size 89.84x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,0.00)}]
         RenderPath {line} at (111.33,72.27) size 89.84x11.72 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M100.00,100.00L200.00,100.00"]
         RenderPath {line} at (117.19,76.95) size 78.12x2.34 [stroke={[type=SOLID] [color=#696969] [stroke width=3.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M100.00,100.00L200.00,100.00"]
-        RenderSVGContainer {use} at (117.19,78.12) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}]
-      RenderSVGContainer {g} at (321.94,233.79) size 116.95x136.20 [transform={m=((0.64,-0.77)(0.77,0.64)) t=(0.00,500.00)}]
+        RenderSVGContainer {use} at (115.23,70.31) size 3.91x15.62 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}]
+          RenderSVGContainer {g} at (115.23,70.31) size 3.91x15.62
+            RenderSVGContainer {svg} at (115.23,70.31) size 3.91x15.62
+              RenderPath {line} at (115.23,70.31) size 3.91x15.62 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
+      RenderSVGContainer {g} at (320.44,232.53) size 119.94x138.72 [transform={m=((0.64,-0.77)(0.77,0.64)) t=(0.00,500.00)}]
         RenderPath {line} at (321.94,233.79) size 116.95x136.20 [stroke={[type=SOLID] [color=#000000] [opacity=0.00] [stroke width=15.00] [line cap=SQUARE]}] [fill={[type=SOLID] [color=#000000] [opacity=0.00]}] [data="M300.00,300.00L500.00,300.00"]
         RenderPath {line} at (329.30,241.29) size 102.23x121.20 [stroke={[type=SOLID] [color=#696969] [stroke width=3.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M300.00,300.00L500.00,300.00"]
-        RenderSVGContainer {use} at (370.37,313.86) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(380.00,300.00)}]
+        RenderSVGContainer {use} at (363.13,307.34) size 14.48x13.04 [transform={m=((1.00,0.00)(0.00,1.00)) t=(380.00,300.00)}]
+          RenderSVGContainer {g} at (363.13,307.34) size 14.48x13.04
+            RenderSVGContainer {svg} at (363.13,307.34) size 14.48x13.04
+              RenderPath {line} at (363.13,307.34) size 14.48x13.04 [stroke={[type=SOLID] [color=#696969] [stroke width=5.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,-10.00L0.00,10.00"]
       RenderSVGText {text} at (20,700) size 800x18
         RenderSVGInlineText {#text} at (0,-14) size 62x18
           text run at (0,-14) width 62: "Statusbar:"
index c6cadb7..a0e4f91 100644 (file)
Binary files a/LayoutTests/svg/carto.net/window-expected.png and b/LayoutTests/svg/carto.net/window-expected.png differ
index 8e81a96..3a35481 100644 (file)
@@ -85,10 +85,22 @@ layer at (0,0) size 800x600
             RenderSVGText {text} at (3,197) size 800x11
               RenderSVGInlineText {#text} at (0,-9) size 45x11
                 text run at (0,-9) width 45: "Statusbar"
-          RenderSVGContainer {g} at (625,92.97) size 0x0
-            RenderSVGContainer {use} at (625,92.97) size 0x0
-            RenderSVGContainer {use} at (625,92.97) size 0x0
-            RenderSVGContainer {use} at (625,92.97) size 0x0
+          RenderSVGContainer {g} at (757.03,94.92) size 35.43x9.38
+            RenderSVGContainer {use} at (783.32,95.04) size 9.15x9.15
+              RenderSVGContainer {g} at (783.32,95.04) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(208.50,8.50)}]
+                RenderSVGContainer {svg} at (783.32,95.04) size 9.15x9.15
+                  RenderPath {rect} at (783.59,95.31) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                  RenderPath {line} at (783.32,95.04) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
+                  RenderPath {line} at (783.32,95.04) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
+            RenderSVGContainer {use} at (769.92,94.92) size 9.38x9.38
+              RenderSVGContainer {g} at (769.92,94.92) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(191.50,8.50)}]
+                RenderSVGContainer {svg} at (769.92,94.92) size 9.38x9.38
+                  RenderPath {rect} at (769.92,94.92) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+            RenderSVGContainer {use} at (757.03,95.31) size 8.59x8.98
+              RenderSVGContainer {g} at (757.03,95.31) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(174.50,8.50)}]
+                RenderSVGContainer {svg} at (757.03,95.31) size 8.59x8.98
+                  RenderPath {rect} at (757.03,95.31) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                  RenderPath {line} at (757.03,103.52) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
         RenderSVGContainer {g} at (38.67,143.36) size 547.66x391.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,150.00)}]
           RenderSVGContainer {g} at (38.67,143.36) size 547.66x391.41
             RenderPath {rect} at (38.67,143.36) size 547.66x391.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L700.00,0.00L700.00,500.00L0.00,500.00"]
@@ -118,9 +130,21 @@ layer at (0,0) size 800x600
                     RenderSVGText {text} at (3,14) size 800x16
                       RenderSVGInlineText {#text} at (0,-13) size 85x16
                         text run at (0,-13) width 85: "Colour Picker"
-                    RenderSVGContainer {use} at (78.12,196.09) size 0x0
-                    RenderSVGContainer {use} at (78.12,196.09) size 0x0
-                    RenderSVGContainer {use} at (78.12,196.09) size 0x0
+                    RenderSVGContainer {use} at (236.44,198.16) size 9.15x9.15
+                      RenderSVGContainer {g} at (236.44,198.16) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(208.50,8.50)}]
+                        RenderSVGContainer {svg} at (236.44,198.16) size 9.15x9.15
+                          RenderPath {rect} at (236.72,198.44) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                          RenderPath {line} at (236.44,198.16) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
+                          RenderPath {line} at (236.44,198.16) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
+                    RenderSVGContainer {use} at (223.05,198.05) size 9.38x9.38
+                      RenderSVGContainer {g} at (223.05,198.05) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(191.50,8.50)}]
+                        RenderSVGContainer {svg} at (223.05,198.05) size 9.38x9.38
+                          RenderPath {rect} at (223.05,198.05) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                    RenderSVGContainer {use} at (210.16,198.44) size 8.59x8.98
+                      RenderSVGContainer {g} at (210.16,198.44) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(174.50,8.50)}]
+                        RenderSVGContainer {svg} at (210.16,198.44) size 8.59x8.98
+                          RenderPath {rect} at (210.16,198.44) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                          RenderPath {line} at (210.16,206.64) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
                 RenderSVGContainer {g} at (249.61,344.14) size 141.41x63.28 [transform={m=((1.00,0.00)(0.00,1.00)) t=(220.00,207.00)}]
                   RenderSVGContainer {g} at (249.61,344.14) size 141.41x63.28
                     RenderPath {rect} at (249.61,344.14) size 141.41x63.28 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L180.00,0.00L180.00,80.00L0.00,80.00"]
@@ -139,16 +163,35 @@ layer at (0,0) size 800x600
                     RenderSVGText {text} at (3,14) size 800x16
                       RenderSVGInlineText {#text} at (0,-13) size 94x16
                         text run at (0,-13) width 94: "Status Window"
-                    RenderSVGContainer {use} at (250,344.53) size 0x0
-                    RenderSVGContainer {use} at (250,344.53) size 0x0
+                    RenderSVGContainer {use} at (376.95,346.48) size 9.38x9.38
+                      RenderSVGContainer {g} at (376.95,346.48) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(168.50,8.50)}]
+                        RenderSVGContainer {svg} at (376.95,346.48) size 9.38x9.38
+                          RenderPath {rect} at (376.95,346.48) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                    RenderSVGContainer {use} at (364.06,346.88) size 8.59x8.98
+                      RenderSVGContainer {g} at (364.06,346.88) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(151.50,8.50)}]
+                        RenderSVGContainer {svg} at (364.06,346.88) size 8.59x8.98
+                          RenderPath {rect} at (364.06,346.88) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                          RenderPath {line} at (364.06,355.08) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
               RenderSVGContainer {g} at (77.73,182.42) size 313.28x14.06
                 RenderPath {rect} at (77.73,182.42) size 313.28x14.06 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#DCDCDC]}] [data="M0.00,0.00L400.00,0.00L400.00,17.00L0.00,17.00"]
                 RenderSVGText {text} at (3,14) size 800x16
                   RenderSVGInlineText {#text} at (0,-13) size 170x16
                     text run at (0,-13) width 170: "Nested middlesize Window"
-                RenderSVGContainer {use} at (78.12,182.81) size 0x0
-                RenderSVGContainer {use} at (78.12,182.81) size 0x0
-                RenderSVGContainer {use} at (78.12,182.81) size 0x0
+                RenderSVGContainer {use} at (377.07,184.88) size 9.15x9.15
+                  RenderSVGContainer {g} at (377.07,184.88) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(388.50,8.50)}]
+                    RenderSVGContainer {svg} at (377.07,184.88) size 9.15x9.15
+                      RenderPath {rect} at (377.34,185.16) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                      RenderPath {line} at (377.07,184.88) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
+                      RenderPath {line} at (377.07,184.88) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
+                RenderSVGContainer {use} at (363.67,184.77) size 9.38x9.38
+                  RenderSVGContainer {g} at (363.67,184.77) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(371.50,8.50)}]
+                    RenderSVGContainer {svg} at (363.67,184.77) size 9.38x9.38
+                      RenderPath {rect} at (363.67,184.77) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                RenderSVGContainer {use} at (350.78,185.16) size 8.59x8.98
+                  RenderSVGContainer {g} at (350.78,185.16) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(354.50,8.50)}]
+                    RenderSVGContainer {svg} at (350.78,185.16) size 8.59x8.98
+                      RenderPath {rect} at (350.78,185.16) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                      RenderPath {line} at (350.78,193.36) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
             RenderSVGContainer {g} at (312.11,377.73) size 157.03x141.41 [transform={m=((1.00,0.00)(0.00,1.00)) t=(350.00,300.00)}]
               RenderSVGContainer {g} at (312.11,377.73) size 157.03x141.41
                 RenderPath {rect} at (312.11,377.73) size 157.03x141.41 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L200.00,0.00L200.00,180.00L0.00,180.00"]
@@ -177,9 +220,21 @@ layer at (0,0) size 800x600
                 RenderSVGText {text} at (3,14) size 800x16
                   RenderSVGInlineText {#text} at (0,-13) size 89x16
                     text run at (0,-13) width 89: "Small Window"
-                RenderSVGContainer {use} at (312.50,378.12) size 0x0
-                RenderSVGContainer {use} at (312.50,378.12) size 0x0
-                RenderSVGContainer {use} at (312.50,378.12) size 0x0
+                RenderSVGContainer {use} at (455.19,380.19) size 9.15x9.15
+                  RenderSVGContainer {g} at (455.19,380.19) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(188.50,8.50)}]
+                    RenderSVGContainer {svg} at (455.19,380.19) size 9.15x9.15
+                      RenderPath {rect} at (455.47,380.47) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                      RenderPath {line} at (455.19,380.19) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
+                      RenderPath {line} at (455.19,380.19) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
+                RenderSVGContainer {use} at (441.80,380.08) size 9.38x9.38
+                  RenderSVGContainer {g} at (441.80,380.08) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(171.50,8.50)}]
+                    RenderSVGContainer {svg} at (441.80,380.08) size 9.38x9.38
+                      RenderPath {rect} at (441.80,380.08) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                RenderSVGContainer {use} at (428.91,380.47) size 8.59x8.98
+                  RenderSVGContainer {g} at (428.91,380.47) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(154.50,8.50)}]
+                    RenderSVGContainer {svg} at (428.91,380.47) size 8.59x8.98
+                      RenderPath {rect} at (428.91,380.47) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                      RenderPath {line} at (428.91,388.67) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
             RenderSVGContainer {g} at (39.45,476.17) size 117.97x47.66 [transform={m=((1.00,0.00)(0.00,1.00)) t=(1.00,426.00)}]
               RenderSVGContainer {g} at (39.45,476.17) size 117.97x47.66
                 RenderPath {rect} at (39.45,476.17) size 117.97x47.66 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#F0F8FF]}] [data="M0.00,0.00L150.00,0.00L150.00,60.00L0.00,60.00"]
@@ -199,6 +254,18 @@ layer at (0,0) size 800x600
             RenderSVGText {text} at (3,14) size 800x16
               RenderSVGInlineText {#text} at (0,-13) size 74x16
                 text run at (0,-13) width 74: "Big Window"
-            RenderSVGContainer {use} at (39.06,143.75) size 0x0
-            RenderSVGContainer {use} at (39.06,143.75) size 0x0
-            RenderSVGContainer {use} at (39.06,143.75) size 0x0
+            RenderSVGContainer {use} at (572.38,145.82) size 9.15x9.15
+              RenderSVGContainer {g} at (572.38,145.82) size 9.15x9.15 [transform={m=((1.00,0.00)(0.00,1.00)) t=(688.50,8.50)}]
+                RenderSVGContainer {svg} at (572.38,145.82) size 9.15x9.15
+                  RenderPath {rect} at (572.66,146.09) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                  RenderPath {line} at (572.38,145.82) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.50,-5.50L5.50,5.50"]
+                  RenderPath {line} at (572.38,145.82) size 9.15x9.15 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,-5.50L-5.50,5.50"]
+            RenderSVGContainer {use} at (558.98,145.70) size 9.38x9.38
+              RenderSVGContainer {g} at (558.98,145.70) size 9.38x9.38 [transform={m=((1.00,0.00)(0.00,1.00)) t=(671.50,8.50)}]
+                RenderSVGContainer {svg} at (558.98,145.70) size 9.38x9.38
+                  RenderPath {rect} at (558.98,145.70) size 9.38x9.38 [stroke={[type=SOLID] [color=#696969]}] [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+            RenderSVGContainer {use} at (546.09,146.09) size 8.59x8.98
+              RenderSVGContainer {g} at (546.09,146.09) size 8.59x8.98 [transform={m=((1.00,0.00)(0.00,1.00)) t=(654.50,8.50)}]
+                RenderSVGContainer {svg} at (546.09,146.09) size 8.59x8.98
+                  RenderPath {rect} at (546.09,146.09) size 8.59x8.59 [data="M-5.50,-5.50L5.50,-5.50L5.50,5.50L-5.50,5.50"]
+                  RenderPath {line} at (546.09,154.30) size 8.59x0.78 [stroke={[type=SOLID] [color=#696969]}] [fill={[type=SOLID] [color=#000000]}] [data="M5.50,5.50L-5.50,5.50"]
index 4d54e16..2ed4870 100644 (file)
Binary files a/LayoutTests/svg/custom/use-forward-refs-expected.png and b/LayoutTests/svg/custom/use-forward-refs-expected.png differ
index d0817b7..e00408c 100644 (file)
@@ -1,20 +1,52 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-    RenderSVGContainer {svg} at (49.83,29.73) size 40.33x50.54
-      RenderSVGContainer {use} at (-39.84,-20.16) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-39.84,-20.16)}]
-      RenderSVGContainer {use} at (-37.34,-18.59) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-37.34,-18.59)}]
-      RenderSVGContainer {use} at (-34.84,-17.66) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-34.84,-17.66)}]
-      RenderSVGContainer {use} at (-32.34,-16.09) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-32.34,-16.09)}]
-      RenderSVGContainer {use} at (-30.16,-15.16) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-30.16,-15.16)}]
-      RenderSVGContainer {use} at (-27.34,-13.59) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-27.34,-13.59)}]
-      RenderSVGContainer {use} at (-25.16,-12.66) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-25.16,-12.66)}]
-      RenderSVGContainer {use} at (-22.34,-11.41) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-22.34,-11.41)}]
-      RenderSVGContainer {use} at (-19.84,-10.16) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-19.84,-10.16)}]
-      RenderSVGContainer {use} at (-17.34,-8.91) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-17.34,-8.91)}]
-      RenderSVGContainer {use} at (-14.84,-7.66) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-14.84,-7.66)}]
-      RenderSVGContainer {use} at (-12.66,-6.41) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-12.66,-6.41)}]
-      RenderSVGContainer {use} at (-9.84,-5.16) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-9.84,-5.16)}]
-      RenderSVGContainer {use} at (-7.66,-3.91) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-7.66,-3.91)}]
-      RenderSVGContainer {use} at (-5.16,-2.66) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-5.16,-2.66)}]
-      RenderSVGContainer {use} at (-2.66,-1.41) size 0x0 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-2.66,-1.41)}]
+    RenderSVGContainer {svg} at (9.99,9.57) size 80.18x70.70
+      RenderSVGContainer {use} at (9.99,9.57) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-39.84,-20.16)}]
+        RenderSVGContainer {g} at (9.99,9.57) size 40.33x50.54
+          RenderPath {path} at (9.99,9.57) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (12.49,11.14) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-37.34,-18.59)}]
+        RenderSVGContainer {g} at (12.49,11.14) size 40.33x50.54
+          RenderPath {path} at (12.49,11.14) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (14.99,12.07) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-34.84,-17.66)}]
+        RenderSVGContainer {g} at (14.99,12.07) size 40.33x50.54
+          RenderPath {path} at (14.99,12.07) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (17.49,13.64) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-32.34,-16.09)}]
+        RenderSVGContainer {g} at (17.49,13.64) size 40.33x50.54
+          RenderPath {path} at (17.49,13.64) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (19.68,14.57) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-30.16,-15.16)}]
+        RenderSVGContainer {g} at (19.68,14.57) size 40.33x50.54
+          RenderPath {path} at (19.68,14.57) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (22.49,16.14) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-27.34,-13.59)}]
+        RenderSVGContainer {g} at (22.49,16.14) size 40.33x50.54
+          RenderPath {path} at (22.49,16.14) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (24.68,17.07) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-25.16,-12.66)}]
+        RenderSVGContainer {g} at (24.68,17.07) size 40.33x50.54
+          RenderPath {path} at (24.68,17.07) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (27.49,18.32) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-22.34,-11.41)}]
+        RenderSVGContainer {g} at (27.49,18.32) size 40.33x50.54
+          RenderPath {path} at (27.49,18.32) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (29.99,19.57) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-19.84,-10.16)}]
+        RenderSVGContainer {g} at (29.99,19.57) size 40.33x50.54
+          RenderPath {path} at (29.99,19.57) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (32.49,20.82) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-17.34,-8.91)}]
+        RenderSVGContainer {g} at (32.49,20.82) size 40.33x50.54
+          RenderPath {path} at (32.49,20.82) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (34.99,22.07) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-14.84,-7.66)}]
+        RenderSVGContainer {g} at (34.99,22.07) size 40.33x50.54
+          RenderPath {path} at (34.99,22.07) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (37.18,23.32) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-12.66,-6.41)}]
+        RenderSVGContainer {g} at (37.18,23.32) size 40.33x50.54
+          RenderPath {path} at (37.18,23.32) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (39.99,24.57) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-9.84,-5.16)}]
+        RenderSVGContainer {g} at (39.99,24.57) size 40.33x50.54
+          RenderPath {path} at (39.99,24.57) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (42.18,25.82) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-7.66,-3.91)}]
+        RenderSVGContainer {g} at (42.18,25.82) size 40.33x50.54
+          RenderPath {path} at (42.18,25.82) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (44.68,27.07) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-5.16,-2.66)}]
+        RenderSVGContainer {g} at (44.68,27.07) size 40.33x50.54
+          RenderPath {path} at (44.68,27.07) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
+      RenderSVGContainer {use} at (47.18,28.32) size 40.33x50.54 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-2.66,-1.41)}]
+        RenderSVGContainer {g} at (47.18,28.32) size 40.33x50.54
+          RenderPath {path} at (47.18,28.32) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
       RenderPath {path} at (49.83,29.73) size 40.33x50.54 [stroke={[type=SOLID] [color=#000000] [stroke width=0.33]}] [fill={[type=SOLID] [color=#4C4C4C]}] [data="M50.00,50.00L50.00,80.00L90.00,60.00L90.00,30.00"]
diff --git a/LayoutTests/svg/custom/use-instanceRoot-modifications-expected.checksum b/LayoutTests/svg/custom/use-instanceRoot-modifications-expected.checksum
new file mode 100644 (file)
index 0000000..e33d4a3
--- /dev/null
@@ -0,0 +1 @@
+18a5813b7e853e8dcc479baf2536419d
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/use-instanceRoot-modifications-expected.png b/LayoutTests/svg/custom/use-instanceRoot-modifications-expected.png
new file mode 100644 (file)
index 0000000..d981ca2
Binary files /dev/null and b/LayoutTests/svg/custom/use-instanceRoot-modifications-expected.png differ
diff --git a/LayoutTests/svg/custom/use-instanceRoot-modifications-expected.txt b/LayoutTests/svg/custom/use-instanceRoot-modifications-expected.txt
new file mode 100644 (file)
index 0000000..42b7d7b
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (-5,-10) size 380x158
+      RenderSVGContainer {defs} at (-5,-10) size 130x40
+        RenderSVGContainer {g} at (-5,-10) size 130x40
+          RenderPath {rect} at (-5,-5) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+          RenderPath {circle} at (40,-10) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [data="M40.00,5.00L39.98,5.63L39.92,6.25L39.82,6.87L39.69,7.49L39.51,8.09L39.30,8.68L39.05,9.26L38.76,9.82L38.44,10.36L38.09,10.88L37.71,11.37L37.29,11.85L36.85,12.29L36.37,12.71L35.88,13.09L35.36,13.44L34.82,13.76L34.26,14.05L33.68,14.30L33.09,14.51L32.49,14.69L31.87,14.82L31.25,14.92L30.63,14.98L30.00,15.00L29.37,14.98L28.75,14.92L28.13,14.82L27.51,14.69L26.91,14.51L26.32,14.30L25.74,14.05L25.18,13.76L24.64,13.44L24.12,13.09L23.63,12.71L23.15,12.29L22.71,11.85L22.29,11.37L21.91,10.88L21.56,10.36L21.24,9.82L20.95,9.26L20.70,8.68L20.49,8.09L20.31,7.49L20.18,6.87L20.08,6.25L20.02,5.63L20.00,5.00L20.02,4.37L20.08,3.75L20.18,3.13L20.31,2.51L20.49,1.91L20.70,1.32L20.95,0.74L21.24,0.18L21.56,-0.36L21.91,-0.88L22.29,-1.37L22.71,-1.85L23.15,-2.29L23.63,-2.71L24.12,-3.09L24.64,-3.44L25.18,-3.76L25.74,-4.05L26.32,-4.30L26.91,-4.51L27.51,-4.69L28.13,-4.82L28.75,-4.92L29.37,-4.98L30.00,-5.00L30.63,-4.98L31.25,-4.92L31.87,-4.82L32.49,-4.69L33.09,-4.51L33.68,-4.30L34.26,-4.05L34.82,-3.76L35.36,-3.44L35.88,-3.09L36.37,-2.71L36.85,-2.29L37.29,-1.85L37.71,-1.37L38.09,-0.88L38.44,-0.36L38.76,0.18L39.05,0.74L39.30,1.32L39.51,1.91L39.69,2.51L39.82,3.13L39.92,3.75L39.98,4.37"]
+      RenderSVGContainer {use} at (45,40) size 130x40
+        RenderSVGContainer {g} at (45,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
+          RenderSVGContainer {g} at (45,40) size 130x40
+            RenderPath {rect} at (45,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+            RenderPath {circle} at (90,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [data="M40.00,5.00L39.98,5.63L39.92,6.25L39.82,6.87L39.69,7.49L39.51,8.09L39.30,8.68L39.05,9.26L38.76,9.82L38.44,10.36L38.09,10.88L37.71,11.37L37.29,11.85L36.85,12.29L36.37,12.71L35.88,13.09L35.36,13.44L34.82,13.76L34.26,14.05L33.68,14.30L33.09,14.51L32.49,14.69L31.87,14.82L31.25,14.92L30.63,14.98L30.00,15.00L29.37,14.98L28.75,14.92L28.13,14.82L27.51,14.69L26.91,14.51L26.32,14.30L25.74,14.05L25.18,13.76L24.64,13.44L24.12,13.09L23.63,12.71L23.15,12.29L22.71,11.85L22.29,11.37L21.91,10.88L21.56,10.36L21.24,9.82L20.95,9.26L20.70,8.68L20.49,8.09L20.31,7.49L20.18,6.87L20.08,6.25L20.02,5.63L20.00,5.00L20.02,4.37L20.08,3.75L20.18,3.13L20.31,2.51L20.49,1.91L20.70,1.32L20.95,0.74L21.24,0.18L21.56,-0.36L21.91,-0.88L22.29,-1.37L22.71,-1.85L23.15,-2.29L23.63,-2.71L24.12,-3.09L24.64,-3.44L25.18,-3.76L25.74,-4.05L26.32,-4.30L26.91,-4.51L27.51,-4.69L28.13,-4.82L28.75,-4.92L29.37,-4.98L30.00,-5.00L30.63,-4.98L31.25,-4.92L31.87,-4.82L32.49,-4.69L33.09,-4.51L33.68,-4.30L34.26,-4.05L34.82,-3.76L35.36,-3.44L35.88,-3.09L36.37,-2.71L36.85,-2.29L37.29,-1.85L37.71,-1.37L38.09,-0.88L38.44,-0.36L38.76,0.18L39.05,0.74L39.30,1.32L39.51,1.91L39.69,2.51L39.82,3.13L39.92,3.75L39.98,4.37"]
+      RenderSVGContainer {use} at (245,40) size 130x40
+        RenderSVGContainer {g} at (245,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
+          RenderSVGContainer {g} at (245,40) size 130x40
+            RenderPath {rect} at (245,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+            RenderPath {circle} at (290,40) size 40x40 [opacity=0.80] [fill={[type=SOLID] [color=#008000]}] [data="M40.00,5.00L39.98,5.63L39.92,6.25L39.82,6.87L39.69,7.49L39.51,8.09L39.30,8.68L39.05,9.26L38.76,9.82L38.44,10.36L38.09,10.88L37.71,11.37L37.29,11.85L36.85,12.29L36.37,12.71L35.88,13.09L35.36,13.44L34.82,13.76L34.26,14.05L33.68,14.30L33.09,14.51L32.49,14.69L31.87,14.82L31.25,14.92L30.63,14.98L30.00,15.00L29.37,14.98L28.75,14.92L28.13,14.82L27.51,14.69L26.91,14.51L26.32,14.30L25.74,14.05L25.18,13.76L24.64,13.44L24.12,13.09L23.63,12.71L23.15,12.29L22.71,11.85L22.29,11.37L21.91,10.88L21.56,10.36L21.24,9.82L20.95,9.26L20.70,8.68L20.49,8.09L20.31,7.49L20.18,6.87L20.08,6.25L20.02,5.63L20.00,5.00L20.02,4.37L20.08,3.75L20.18,3.13L20.31,2.51L20.49,1.91L20.70,1.32L20.95,0.74L21.24,0.18L21.56,-0.36L21.91,-0.88L22.29,-1.37L22.71,-1.85L23.15,-2.29L23.63,-2.71L24.12,-3.09L24.64,-3.44L25.18,-3.76L25.74,-4.05L26.32,-4.30L26.91,-4.51L27.51,-4.69L28.13,-4.82L28.75,-4.92L29.37,-4.98L30.00,-5.00L30.63,-4.98L31.25,-4.92L31.87,-4.82L32.49,-4.69L33.09,-4.51L33.68,-4.30L34.26,-4.05L34.82,-3.76L35.36,-3.44L35.88,-3.09L36.37,-2.71L36.85,-2.29L37.29,-1.85L37.71,-1.37L38.09,-0.88L38.44,-0.36L38.76,0.18L39.05,0.74L39.30,1.32L39.51,1.91L39.69,2.51L39.82,3.13L39.92,3.75L39.98,4.37"]
+      RenderSVGText {text} at (70,70) size 800x18
+        RenderSVGInlineText {#text} at (0,-14) size 77x18
+          text run at (0,-14) width 77: "Test passed."
diff --git a/LayoutTests/svg/custom/use-instanceRoot-modifications.svg b/LayoutTests/svg/custom/use-instanceRoot-modifications.svg
new file mode 100644 (file)
index 0000000..7aea17b
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg viewBox="0 0 400 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+    <g id="g">
+        <rect id="rect" stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
+        <circle id="circle" opacity="0.5" fill="green" cx="30" cy="5" r="10"/>
+    </g>
+</defs>
+
+<use x="25" y="25" xlink:href="#g"/>
+<use x="125" y="25" xlink:href="#g"/>
+
+<text id="text" x="70" y="70">Test failed.</text>
+
+<script>
+var useElement = document.getElementsByTagName("use")[1];
+if (useElement != useElement.instanceRoot.correspondingUseElement)
+    return;
+
+var element = useElement.instanceRoot.correspondingElement;
+if (element != document.getElementById("g"))
+    return;
+
+// element.firstChild is a #text node! the next sibling gives the rect
+var rect = element.firstChild.nextSibling;
+if (rect != document.getElementById("rect"))
+    return;
+
+// rect.nextSibling is a #text node! the next sibling gives the circle
+var circle = rect.nextSibling.nextSibling;
+if (circle != document.getElementById("circle"))
+    return;
+
+rect.setAttribute("fill", "green");
+circle.setAttribute("opacity", "0.8");
+
+document.getElementById("text").firstChild.nodeValue = "Test passed.";
+</script>
+</svg>
diff --git a/LayoutTests/svg/custom/use-on-g-expected.checksum b/LayoutTests/svg/custom/use-on-g-expected.checksum
new file mode 100644 (file)
index 0000000..4cee4b3
--- /dev/null
@@ -0,0 +1 @@
+45549a45fd4362e247651975d5d925bd
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/use-on-g-expected.png b/LayoutTests/svg/custom/use-on-g-expected.png
new file mode 100644 (file)
index 0000000..4556ce3
Binary files /dev/null and b/LayoutTests/svg/custom/use-on-g-expected.png differ
diff --git a/LayoutTests/svg/custom/use-on-g-expected.txt b/LayoutTests/svg/custom/use-on-g-expected.txt
new file mode 100644 (file)
index 0000000..b97d8f6
--- /dev/null
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (-5,-10) size 505x138
+      RenderSVGContainer {defs} at (-5,-10) size 130x40
+        RenderSVGContainer {g} at (-5,-10) size 130x40
+          RenderPath {rect} at (-5,-5) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+          RenderPath {circle} at (40,-10) size 40x40 [opacity=0.50] [fill={[type=SOLID] [color=#008000]}] [data="M40.00,5.00L39.98,5.63L39.92,6.25L39.82,6.87L39.69,7.49L39.51,8.09L39.30,8.68L39.05,9.26L38.76,9.82L38.44,10.36L38.09,10.88L37.71,11.37L37.29,11.85L36.85,12.29L36.37,12.71L35.88,13.09L35.36,13.44L34.82,13.76L34.26,14.05L33.68,14.30L33.09,14.51L32.49,14.69L31.87,14.82L31.25,14.92L30.63,14.98L30.00,15.00L29.37,14.98L28.75,14.92L28.13,14.82L27.51,14.69L26.91,14.51L26.32,14.30L25.74,14.05L25.18,13.76L24.64,13.44L24.12,13.09L23.63,12.71L23.15,12.29L22.71,11.85L22.29,11.37L21.91,10.88L21.56,10.36L21.24,9.82L20.95,9.26L20.70,8.68L20.49,8.09L20.31,7.49L20.18,6.87L20.08,6.25L20.02,5.63L20.00,5.00L20.02,4.37L20.08,3.75L20.18,3.13L20.31,2.51L20.49,1.91L20.70,1.32L20.95,0.74L21.24,0.18L21.56,-0.36L21.91,-0.88L22.29,-1.37L22.71,-1.85L23.15,-2.29L23.63,-2.71L24.12,-3.09L24.64,-3.44L25.18,-3.76L25.74,-4.05L26.32,-4.30L26.91,-4.51L27.51,-4.69L28.13,-4.82L28.75,-4.92L29.37,-4.98L30.00,-5.00L30.63,-4.98L31.25,-4.92L31.87,-4.82L32.49,-4.69L33.09,-4.51L33.68,-4.30L34.26,-4.05L34.82,-3.76L35.36,-3.44L35.88,-3.09L36.37,-2.71L36.85,-2.29L37.29,-1.85L37.71,-1.37L38.09,-0.88L38.44,-0.36L38.76,0.18L39.05,0.74L39.30,1.32L39.51,1.91L39.69,2.51L39.82,3.13L39.92,3.75L39.98,4.37"]
+      RenderSVGContainer {g} at (245,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
+        RenderSVGContainer {g} at (245,40) size 130x40
+          RenderPath {rect} at (245,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+          RenderPath {circle} at (290,40) size 40x40 [opacity=0.50] [fill={[type=SOLID] [color=#008000]}] [data="M40.00,5.00L39.98,5.63L39.92,6.25L39.82,6.87L39.69,7.49L39.51,8.09L39.30,8.68L39.05,9.26L38.76,9.82L38.44,10.36L38.09,10.88L37.71,11.37L37.29,11.85L36.85,12.29L36.37,12.71L35.88,13.09L35.36,13.44L34.82,13.76L34.26,14.05L33.68,14.30L33.09,14.51L32.49,14.69L31.87,14.82L31.25,14.92L30.63,14.98L30.00,15.00L29.37,14.98L28.75,14.92L28.13,14.82L27.51,14.69L26.91,14.51L26.32,14.30L25.74,14.05L25.18,13.76L24.64,13.44L24.12,13.09L23.63,12.71L23.15,12.29L22.71,11.85L22.29,11.37L21.91,10.88L21.56,10.36L21.24,9.82L20.95,9.26L20.70,8.68L20.49,8.09L20.31,7.49L20.18,6.87L20.08,6.25L20.02,5.63L20.00,5.00L20.02,4.37L20.08,3.75L20.18,3.13L20.31,2.51L20.49,1.91L20.70,1.32L20.95,0.74L21.24,0.18L21.56,-0.36L21.91,-0.88L22.29,-1.37L22.71,-1.85L23.15,-2.29L23.63,-2.71L24.12,-3.09L24.64,-3.44L25.18,-3.76L25.74,-4.05L26.32,-4.30L26.91,-4.51L27.51,-4.69L28.13,-4.82L28.75,-4.92L29.37,-4.98L30.00,-5.00L30.63,-4.98L31.25,-4.92L31.87,-4.82L32.49,-4.69L33.09,-4.51L33.68,-4.30L34.26,-4.05L34.82,-3.76L35.36,-3.44L35.88,-3.09L36.37,-2.71L36.85,-2.29L37.29,-1.85L37.71,-1.37L38.09,-0.88L38.44,-0.36L38.76,0.18L39.05,0.74L39.30,1.32L39.51,1.91L39.69,2.51L39.82,3.13L39.92,3.75L39.98,4.37"]
+      RenderSVGText {text} at (10,60) size 800x18
+        RenderSVGInlineText {#text} at (0,-14) size 240x18
+          text run at (0,-14) width 240: "The two objects should look identical."
+      RenderSVGContainer {use} at (45,40) size 130x40
+        RenderSVGContainer {g} at (45,40) size 130x40 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
+          RenderSVGContainer {g} at (45,40) size 130x40
+            RenderPath {rect} at (45,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+            RenderPath {circle} at (90,40) size 40x40 [opacity=0.50] [fill={[type=SOLID] [color=#008000]}] [data="M40.00,5.00L39.98,5.63L39.92,6.25L39.82,6.87L39.69,7.49L39.51,8.09L39.30,8.68L39.05,9.26L38.76,9.82L38.44,10.36L38.09,10.88L37.71,11.37L37.29,11.85L36.85,12.29L36.37,12.71L35.88,13.09L35.36,13.44L34.82,13.76L34.26,14.05L33.68,14.30L33.09,14.51L32.49,14.69L31.87,14.82L31.25,14.92L30.63,14.98L30.00,15.00L29.37,14.98L28.75,14.92L28.13,14.82L27.51,14.69L26.91,14.51L26.32,14.30L25.74,14.05L25.18,13.76L24.64,13.44L24.12,13.09L23.63,12.71L23.15,12.29L22.71,11.85L22.29,11.37L21.91,10.88L21.56,10.36L21.24,9.82L20.95,9.26L20.70,8.68L20.49,8.09L20.31,7.49L20.18,6.87L20.08,6.25L20.02,5.63L20.00,5.00L20.02,4.37L20.08,3.75L20.18,3.13L20.31,2.51L20.49,1.91L20.70,1.32L20.95,0.74L21.24,0.18L21.56,-0.36L21.91,-0.88L22.29,-1.37L22.71,-1.85L23.15,-2.29L23.63,-2.71L24.12,-3.09L24.64,-3.44L25.18,-3.76L25.74,-4.05L26.32,-4.30L26.91,-4.51L27.51,-4.69L28.13,-4.82L28.75,-4.92L29.37,-4.98L30.00,-5.00L30.63,-4.98L31.25,-4.92L31.87,-4.82L32.49,-4.69L33.09,-4.51L33.68,-4.30L34.26,-4.05L34.82,-3.76L35.36,-3.44L35.88,-3.09L36.37,-2.71L36.85,-2.29L37.29,-1.85L37.71,-1.37L38.09,-0.88L38.44,-0.36L38.76,0.18L39.05,0.74L39.30,1.32L39.51,1.91L39.69,2.51L39.82,3.13L39.92,3.75L39.98,4.37"]
diff --git a/LayoutTests/svg/custom/use-on-g.svg b/LayoutTests/svg/custom/use-on-g.svg
new file mode 100644 (file)
index 0000000..de13383
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="800" height="600" viewBox="0 0 400 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+    <g id="g">
+        <rect stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
+        <circle opacity="0.5" fill="green" cx="30" cy="5" r="10"/>
+    </g>
+</defs>
+
+<g transform="translate(125 25)">
+    <g> 
+        <rect stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
+        <circle opacity="0.5" fill="green" cx="30" cy="5" r="10"/>
+    </g>
+</g>
+
+<text x="10" y="60">The two objects should look identical.</text>
+<use x="25" y="25" xlink:href="#g"/>
+</svg>
+
diff --git a/LayoutTests/svg/custom/use-on-rect-expected.checksum b/LayoutTests/svg/custom/use-on-rect-expected.checksum
new file mode 100644 (file)
index 0000000..67119fe
--- /dev/null
@@ -0,0 +1 @@
+e33107562daa5c7a5397ed8403fdbbbc
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/use-on-rect-expected.png b/LayoutTests/svg/custom/use-on-rect-expected.png
new file mode 100644 (file)
index 0000000..b976ca9
Binary files /dev/null and b/LayoutTests/svg/custom/use-on-rect-expected.png differ
diff --git a/LayoutTests/svg/custom/use-on-rect-expected.txt b/LayoutTests/svg/custom/use-on-rect-expected.txt
new file mode 100644 (file)
index 0000000..f844dcf
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (-5,-5) size 505x133
+      RenderSVGContainer {defs} at (-5,-5) size 130x30
+        RenderPath {rect} at (-5,-5) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+      RenderSVGContainer {g} at (245,45) size 130x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
+        RenderPath {rect} at (245,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+      RenderSVGText {text} at (10,60) size 800x18
+        RenderSVGInlineText {#text} at (0,-14) size 240x18
+          text run at (0,-14) width 240: "The two objects should look identical."
+      RenderSVGContainer {use} at (45,45) size 130x30
+        RenderSVGContainer {g} at (45,45) size 130x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
+          RenderPath {rect} at (45,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
diff --git a/LayoutTests/svg/custom/use-on-rect.svg b/LayoutTests/svg/custom/use-on-rect.svg
new file mode 100644 (file)
index 0000000..7f86b55
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="800" height="600" viewBox="0 0 400 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+    <rect id="rect" stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
+</defs>
+
+<g transform="translate(125 25)">
+    <rect stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
+</g>
+
+<text x="10" y="60">The two objects should look identical.</text>
+<use x="25" y="25" xlink:href="#rect"/>
+</svg>
+
diff --git a/LayoutTests/svg/custom/use-on-symbol-expected.checksum b/LayoutTests/svg/custom/use-on-symbol-expected.checksum
new file mode 100644 (file)
index 0000000..67119fe
--- /dev/null
@@ -0,0 +1 @@
+e33107562daa5c7a5397ed8403fdbbbc
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/use-on-symbol-expected.png b/LayoutTests/svg/custom/use-on-symbol-expected.png
new file mode 100644 (file)
index 0000000..b976ca9
Binary files /dev/null and b/LayoutTests/svg/custom/use-on-symbol-expected.png differ
diff --git a/LayoutTests/svg/custom/use-on-symbol-expected.txt b/LayoutTests/svg/custom/use-on-symbol-expected.txt
new file mode 100644 (file)
index 0000000..a5c5331
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (20,45) size 480x83
+      RenderSVGContainer {defs} at (0,0) size 0x0
+      RenderSVGContainer {g} at (245,45) size 130x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
+        RenderPath {rect} at (245,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+      RenderSVGText {text} at (10,60) size 800x18
+        RenderSVGInlineText {#text} at (0,-14) size 240x18
+          text run at (0,-14) width 240: "The two objects should look identical."
+      RenderSVGContainer {use} at (45,45) size 130x30
+        RenderSVGContainer {g} at (45,45) size 130x30 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
+          RenderSVGContainer {svg} at (45,45) size 130x30
+            RenderPath {rect} at (45,45) size 130x30 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
diff --git a/LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.checksum b/LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.checksum
new file mode 100644 (file)
index 0000000..70e84a8
--- /dev/null
@@ -0,0 +1 @@
+b65589677ae81af49bb10d2115fdef98
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.png b/LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.png
new file mode 100644 (file)
index 0000000..b3887b9
Binary files /dev/null and b/LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.png differ
diff --git a/LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.txt b/LayoutTests/svg/custom/use-on-symbol-inside-pattern-expected.txt
new file mode 100644 (file)
index 0000000..96b98a9
--- /dev/null
@@ -0,0 +1,38 @@
+KRenderingPaintServer {id="pat00" [type=PATTERN] [bbox=at (0,0) size 1x1]}
+KRenderingPaintServer {id="pat01" [type=PATTERN] [bbox=at (0,0) size 1x1]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (-1.85,-1.05) size 213.87x202.12
+      RenderSVGContainer {defs} at (-1.85,-1.05) size 203.87x92.12
+        RenderSVGContainer {pattern} at (2.50,3.75) size 15x22.50
+          RenderSVGContainer {use} at (2.50,3.75) size 15x22.50 [transform={m=((0.75,0.00)(0.00,0.75)) t=(10.00,15.00)}]
+            RenderSVGContainer {g} at (2.50,3.75) size 15x22.50
+              RenderSVGContainer {svg} at (2.50,3.75) size 15x22.50
+                RenderPath {path} at (9.25,3.75) size 1.50x22.50 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [data="M0.00,-15.00L0.00,15.00"]
+                RenderPath {path} at (9.25,3.75) size 4.50x3.38 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [data="M0.00,-15.00C0.00,-12.67,1.67,-11.50,5.00,-11.50"]
+                RenderPath {path} at (6.25,3.75) size 4.50x3.38 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [data="M0.00,-15.00C0.00,-12.67,-1.67,-11.50,-5.00,-11.50"]
+                RenderPath {path} at (9.25,8.25) size 6.75x5.25 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [data="M0.00,-9.00C0.00,-5.00,2.67,-3.00,8.00,-3.00"]
+                RenderPath {path} at (4,8.25) size 6.75x5.25 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [data="M0.00,-9.00C0.00,-5.00,-2.67,-3.00,-8.00,-3.00"]
+                RenderPath {path} at (9.25,15) size 8.25x6 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [data="M0.00,0.00C0.00,4.67,3.33,7.00,10.00,7.00"]
+                RenderPath {path} at (2.50,15) size 8.25x6 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [data="M0.00,0.00C0.00,4.67,-3.33,7.00,-10.00,7.00"]
+        RenderSVGContainer {pattern} at (8.94,11.56) size 12.13x15.94
+          RenderSVGContainer {use} at (8.94,11.56) size 12.13x15.94 [transform={m=((0.50,0.00)(0.00,0.50)) t=(15.00,20.00)}]
+            RenderSVGContainer {g} at (8.94,11.56) size 12.13x15.94
+              RenderSVGContainer {svg} at (8.94,11.56) size 12.13x15.94
+                RenderPath {path} at (14.50,22.50) size 1x5 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [data="M0.00,15.00L0.00,5.00"]
+                RenderPath {path} at (8.94,11.56) size 12.13x12.76 [stroke={[type=SOLID] [color=#008000] [stroke width=2.00]}] [data="M0.00,5.00C-1.94,7.10,-5.09,7.54,-7.53,6.05C-9.97,4.56,-11.03,1.56,-10.05,-1.13C-9.07,-3.81,-6.33,-5.43,-3.50,-5.00C-5.62,-6.52,-6.51,-9.23,-5.71,-11.71C-4.91,-14.19,-2.61,-15.87,-0.00,-15.87C2.61,-15.87,4.91,-14.19,5.71,-11.71C6.51,-9.23,5.62,-6.52,3.50,-5.00C6.33,-5.43,9.07,-3.81,10.05,-1.13C11.03,1.56,9.97,4.56,7.53,6.05C5.09,7.54,1.94,7.10,-0.00,5.00"]
+        RenderPath {path} at (-1.85,-1.05) size 203.87x92.12 [stroke={[type=SOLID] [color=#B42D25] [stroke width=2.00]}] [fill={[type=SOLID] [color=#000000]}] [data="M0.00,50.00L100.00,0.00L200.00,20.00L150.00,70.00L50.00,90.00"]
+      RenderSVGContainer {g} at (8.15,6) size 203.87x95.07 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,10.00)}]
+        RenderSVGText {text} at (0,10) size 800x18
+          RenderSVGInlineText {#text} at (0,-14) size 66x18
+            text run at (0,-14) width 66: "coniferous"
+        RenderSVGContainer {use} at (8.15,8.95) size 203.87x92.12
+          RenderSVGContainer {g} at (8.15,8.95) size 203.87x92.12
+            RenderPath {path} at (8.15,8.95) size 203.87x92.12 [stroke={[type=SOLID] [color=#B42D25] [stroke width=2.00]}] [fill={[type=PATTERN] [bbox=at (0,0) size 1x1]}] [data="M0.00,50.00L100.00,0.00L200.00,20.00L150.00,70.00L50.00,90.00"]
+      RenderSVGContainer {g} at (8.15,106) size 203.87x95.07 [transform={m=((1.00,0.00)(0.00,1.00)) t=(10.00,110.00)}]
+        RenderSVGText {text} at (0,10) size 800x18
+          RenderSVGInlineText {#text} at (0,-14) size 75x18
+            text run at (0,-14) width 75: "broadLeave"
+        RenderSVGContainer {use} at (8.15,108.95) size 203.87x92.12
+          RenderSVGContainer {g} at (8.15,108.95) size 203.87x92.12
+            RenderPath {path} at (8.15,108.95) size 203.87x92.12 [stroke={[type=SOLID] [color=#B42D25] [stroke width=2.00]}] [fill={[type=PATTERN] [bbox=at (0,0) size 1x1]}] [data="M0.00,50.00L100.00,0.00L200.00,20.00L150.00,70.00L50.00,90.00"]
diff --git a/LayoutTests/svg/custom/use-on-symbol-inside-pattern.svg b/LayoutTests/svg/custom/use-on-symbol-inside-pattern.svg
new file mode 100644 (file)
index 0000000..ca5ce89
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="iso-8859-1"?>\r
+<!-- georg held -->\r
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/SVG/DTD/svg10.dtd">\r
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" width="225" height="425">\r
+       <title>pattern</title>\r
+       <defs>\r
+               <symbol id="coniferous" overflow="visible" style="fill:none;stroke:green;stroke-width:2">\r
+                       <path d="M0 -15 l0 30"/>\r
+                       <path d="M0 -15 q0 3.5 5 3.5"/>\r
+                       <path d="M0 -15 q0 3.5 -5 3.5"/>\r
+                       <path d="M0 -9 q0 6 8 6"/>\r
+                       <path d="M0 -9 q0 6 -8 6"/>\r
+                       <path d="M0 0 q0 7 10 7"/>\r
+                       <path d="M0 0 q0 7 -10 7"/>             \r
+               </symbol>\r
+               <symbol id="broadLeave" overflow="visible" style="fill:none;stroke:green;stroke-width:2;">\r
+                       <path d="M0 15 l0 -10"/>\r
+                       <path d="M0 5 a6 6 0 1 1 -3.5 -10 a6 6 0 1 1 7 0 a6 6 0 1 1 -3.5 10z"/>\r
+               </symbol>\r
+\r
+               <pattern id="pat00" patternUnits="userSpaceOnUse" width="30" height="45">\r
+                       <use xlink:href="#coniferous" transform="translate(10,15) scale(0.75)"/>\r
+               </pattern>\r
+               <pattern id="pat01" patternUnits="userSpaceOnUse" width="30" height="45">\r
+                       <use xlink:href="#broadLeave" transform="translate(15,20) scale(0.5)"/>\r
+               </pattern>\r
+\r
+               <path id="geometry" style="fill-rule:nonzero;stroke:#B42D25;stroke-width:2;" d="M0 50 l100 -50 100 20 -50 50 -100 20z"/>\r
+       </defs>\r
+       <g transform="translate(10,10)">\r
+               <text x="0" y="10">coniferous</text>\r
+               <use xlink:href="#geometry" style="fill:url(#pat00)"/>\r
+       </g>\r
+       <g transform="translate(10,110)">\r
+               <text x="0" y="10">broadLeave</text>\r
+               <use xlink:href="#geometry" style="fill:url(#pat01)"/>\r
+       </g>\r
+</svg>
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/use-on-symbol.svg b/LayoutTests/svg/custom/use-on-symbol.svg
new file mode 100644 (file)
index 0000000..0af1e4e
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="800" height="600" viewBox="0 0 400 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+    <symbol id="symbol">
+        <rect stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
+    </symbol>
+</defs>
+
+<g transform="translate(125 25)">
+    <rect stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
+</g>
+
+<text x="10" y="60">The two objects should look identical.</text>
+<use x="25" y="25" xlink:href="#symbol"/>
+</svg>
+
diff --git a/LayoutTests/svg/custom/use-on-text-expected.checksum b/LayoutTests/svg/custom/use-on-text-expected.checksum
new file mode 100644 (file)
index 0000000..a76d000
--- /dev/null
@@ -0,0 +1 @@
+6a2ba12656dfb75bc63aa436c212d260
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/use-on-text-expected.png b/LayoutTests/svg/custom/use-on-text-expected.png
new file mode 100644 (file)
index 0000000..429f86a
Binary files /dev/null and b/LayoutTests/svg/custom/use-on-text-expected.png differ
diff --git a/LayoutTests/svg/custom/use-on-text-expected.txt b/LayoutTests/svg/custom/use-on-text-expected.txt
new file mode 100644 (file)
index 0000000..a0ce28a
--- /dev/null
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (0,-52) size 500x180
+      RenderSVGContainer {defs} at (0,-52) size 138x92
+        RenderSVGText {text} at (0,10) size 800x46
+          RenderSVGInlineText {#text} at (0,-36) size 69x46
+            text run at (0,-36) width 69: "Test"
+      RenderSVGContainer {g} at (250,-2) size 138x92 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
+        RenderSVGText {text} at (0,10) size 800x46
+          RenderSVGInlineText {#text} at (0,-36) size 69x46
+            text run at (0,-36) width 69: "Test"
+      RenderSVGText {text} at (10,60) size 800x18
+        RenderSVGInlineText {#text} at (0,-14) size 240x18
+          text run at (0,-14) width 240: "The two objects should look identical."
+      RenderSVGContainer {use} at (50,-2) size 138x92
+        RenderSVGContainer {g} at (50,-2) size 138x92 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
+          RenderSVGText {text} at (0,10) size 800x46
+            RenderSVGInlineText {#text} at (0,-36) size 69x46
+              text run at (0,-36) width 69: "Test"
diff --git a/LayoutTests/svg/custom/use-on-text.svg b/LayoutTests/svg/custom/use-on-text.svg
new file mode 100644 (file)
index 0000000..c9825eb
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="800" height="600" viewBox="0 0 400 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+    <text y="10" id="text" font-size="30pt" stroke-width="2px" fill="red" stroke="navy">Test</text>
+</defs>
+
+<g transform="translate(125 25)">
+    <text y="10" id="text" font-size="30pt" stroke-width="2px" fill="red" stroke="navy">Test</text>
+</g>
+
+<text x="10" y="60">The two objects should look identical.</text>
+<use x="25" y="25" xlink:href="#text"/>
+</svg>
+
diff --git a/LayoutTests/svg/custom/use-transform-expected.checksum b/LayoutTests/svg/custom/use-transform-expected.checksum
new file mode 100644 (file)
index 0000000..d69f5e9
--- /dev/null
@@ -0,0 +1 @@
+36a7fdaa87b23f37ebe14f2200246d03
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/use-transform-expected.png b/LayoutTests/svg/custom/use-transform-expected.png
new file mode 100644 (file)
index 0000000..25bee74
Binary files /dev/null and b/LayoutTests/svg/custom/use-transform-expected.png differ
diff --git a/LayoutTests/svg/custom/use-transform-expected.txt b/LayoutTests/svg/custom/use-transform-expected.txt
new file mode 100644 (file)
index 0000000..5083a90
--- /dev/null
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (-0.10,-50.10) size 500.10x194.78
+      RenderSVGContainer {defs} at (-0.10,-50.10) size 120.21x120.21
+        RenderSVGContainer {g} at (-0.10,-50.10) size 120.21x120.21 [transform={m=((0.71,-0.71)(0.71,0.71)) t=(5.25,22.68)}]
+          RenderPath {rect} at (3.43,-46.57) size 113.14x113.14 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+          RenderPath {circle} at (31.72,-18.28) size 56.57x56.57 [opacity=0.50] [fill={[type=SOLID] [color=#008000]}] [data="M40.00,5.00L39.98,5.63L39.92,6.25L39.82,6.87L39.69,7.49L39.51,8.09L39.30,8.68L39.05,9.26L38.76,9.82L38.44,10.36L38.09,10.88L37.71,11.37L37.29,11.85L36.85,12.29L36.37,12.71L35.88,13.09L35.36,13.44L34.82,13.76L34.26,14.05L33.68,14.30L33.09,14.51L32.49,14.69L31.87,14.82L31.25,14.92L30.63,14.98L30.00,15.00L29.37,14.98L28.75,14.92L28.13,14.82L27.51,14.69L26.91,14.51L26.32,14.30L25.74,14.05L25.18,13.76L24.64,13.44L24.12,13.09L23.63,12.71L23.15,12.29L22.71,11.85L22.29,11.37L21.91,10.88L21.56,10.36L21.24,9.82L20.95,9.26L20.70,8.68L20.49,8.09L20.31,7.49L20.18,6.87L20.08,6.25L20.02,5.63L20.00,5.00L20.02,4.37L20.08,3.75L20.18,3.13L20.31,2.51L20.49,1.91L20.70,1.32L20.95,0.74L21.24,0.18L21.56,-0.36L21.91,-0.88L22.29,-1.37L22.71,-1.85L23.15,-2.29L23.63,-2.71L24.12,-3.09L24.64,-3.44L25.18,-3.76L25.74,-4.05L26.32,-4.30L26.91,-4.51L27.51,-4.69L28.13,-4.82L28.75,-4.92L29.37,-4.98L30.00,-5.00L30.63,-4.98L31.25,-4.92L31.87,-4.82L32.49,-4.69L33.09,-4.51L33.68,-4.30L34.26,-4.05L34.82,-3.76L35.36,-3.44L35.88,-3.09L36.37,-2.71L36.85,-2.29L37.29,-1.85L37.71,-1.37L38.09,-0.88L38.44,-0.36L38.76,0.18L39.05,0.74L39.30,1.32L39.51,1.91L39.69,2.51L39.82,3.13L39.92,3.75L39.98,4.37"]
+      RenderSVGContainer {g} at (225.32,-24.68) size 169.35x169.35 [transform={m=((1.00,0.00)(0.00,1.00)) t=(125.00,25.00)}]
+        RenderSVGContainer {g} at (225.32,-24.68) size 169.35x169.35 [transform={m=((0.77,0.64)(-0.64,0.77)) t=(10.23,-18.11)}]
+          RenderSVGContainer {g} at (243.50,34.41) size 132.99x51.18 [transform={m=((0.71,-0.71)(0.71,0.71)) t=(5.25,22.68)}]
+            RenderPath {rect} at (243.94,39.39) size 132.12x41.22 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+            RenderPath {circle} at (288.33,38.33) size 43.33x43.33 [opacity=0.50] [fill={[type=SOLID] [color=#008000]}] [data="M40.00,5.00L39.98,5.63L39.92,6.25L39.82,6.87L39.69,7.49L39.51,8.09L39.30,8.68L39.05,9.26L38.76,9.82L38.44,10.36L38.09,10.88L37.71,11.37L37.29,11.85L36.85,12.29L36.37,12.71L35.88,13.09L35.36,13.44L34.82,13.76L34.26,14.05L33.68,14.30L33.09,14.51L32.49,14.69L31.87,14.82L31.25,14.92L30.63,14.98L30.00,15.00L29.37,14.98L28.75,14.92L28.13,14.82L27.51,14.69L26.91,14.51L26.32,14.30L25.74,14.05L25.18,13.76L24.64,13.44L24.12,13.09L23.63,12.71L23.15,12.29L22.71,11.85L22.29,11.37L21.91,10.88L21.56,10.36L21.24,9.82L20.95,9.26L20.70,8.68L20.49,8.09L20.31,7.49L20.18,6.87L20.08,6.25L20.02,5.63L20.00,5.00L20.02,4.37L20.08,3.75L20.18,3.13L20.31,2.51L20.49,1.91L20.70,1.32L20.95,0.74L21.24,0.18L21.56,-0.36L21.91,-0.88L22.29,-1.37L22.71,-1.85L23.15,-2.29L23.63,-2.71L24.12,-3.09L24.64,-3.44L25.18,-3.76L25.74,-4.05L26.32,-4.30L26.91,-4.51L27.51,-4.69L28.13,-4.82L28.75,-4.92L29.37,-4.98L30.00,-5.00L30.63,-4.98L31.25,-4.92L31.87,-4.82L32.49,-4.69L33.09,-4.51L33.68,-4.30L34.26,-4.05L34.82,-3.76L35.36,-3.44L35.88,-3.09L36.37,-2.71L36.85,-2.29L37.29,-1.85L37.71,-1.37L38.09,-0.88L38.44,-0.36L38.76,0.18L39.05,0.74L39.30,1.32L39.51,1.91L39.69,2.51L39.82,3.13L39.92,3.75L39.98,4.37"]
+      RenderSVGText {text} at (10,60) size 800x18
+        RenderSVGInlineText {#text} at (0,-14) size 240x18
+          text run at (0,-14) width 240: "The two objects should look identical."
+      RenderSVGContainer {g} at (25.32,-24.68) size 169.35x169.35 [transform={m=((0.77,0.64)(-0.64,0.77)) t=(32.15,-28.33)}]
+        RenderSVGContainer {use} at (25.32,-24.68) size 169.35x169.35
+          RenderSVGContainer {g} at (25.32,-24.68) size 169.35x169.35 [transform={m=((1.00,0.00)(0.00,1.00)) t=(25.00,25.00)}]
+            RenderSVGContainer {g} at (43.50,34.41) size 132.99x51.18 [transform={m=((0.71,-0.71)(0.71,0.71)) t=(5.25,22.68)}]
+              RenderPath {rect} at (43.94,39.39) size 132.12x41.22 [stroke={[type=SOLID] [color=#000080] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L60.00,0.00L60.00,10.00L0.00,10.00"]
+              RenderPath {circle} at (88.33,38.33) size 43.33x43.33 [opacity=0.50] [fill={[type=SOLID] [color=#008000]}] [data="M40.00,5.00L39.98,5.63L39.92,6.25L39.82,6.87L39.69,7.49L39.51,8.09L39.30,8.68L39.05,9.26L38.76,9.82L38.44,10.36L38.09,10.88L37.71,11.37L37.29,11.85L36.85,12.29L36.37,12.71L35.88,13.09L35.36,13.44L34.82,13.76L34.26,14.05L33.68,14.30L33.09,14.51L32.49,14.69L31.87,14.82L31.25,14.92L30.63,14.98L30.00,15.00L29.37,14.98L28.75,14.92L28.13,14.82L27.51,14.69L26.91,14.51L26.32,14.30L25.74,14.05L25.18,13.76L24.64,13.44L24.12,13.09L23.63,12.71L23.15,12.29L22.71,11.85L22.29,11.37L21.91,10.88L21.56,10.36L21.24,9.82L20.95,9.26L20.70,8.68L20.49,8.09L20.31,7.49L20.18,6.87L20.08,6.25L20.02,5.63L20.00,5.00L20.02,4.37L20.08,3.75L20.18,3.13L20.31,2.51L20.49,1.91L20.70,1.32L20.95,0.74L21.24,0.18L21.56,-0.36L21.91,-0.88L22.29,-1.37L22.71,-1.85L23.15,-2.29L23.63,-2.71L24.12,-3.09L24.64,-3.44L25.18,-3.76L25.74,-4.05L26.32,-4.30L26.91,-4.51L27.51,-4.69L28.13,-4.82L28.75,-4.92L29.37,-4.98L30.00,-5.00L30.63,-4.98L31.25,-4.92L31.87,-4.82L32.49,-4.69L33.09,-4.51L33.68,-4.30L34.26,-4.05L34.82,-3.76L35.36,-3.44L35.88,-3.09L36.37,-2.71L36.85,-2.29L37.29,-1.85L37.71,-1.37L38.09,-0.88L38.44,-0.36L38.76,0.18L39.05,0.74L39.30,1.32L39.51,1.91L39.69,2.51L39.82,3.13L39.92,3.75L39.98,4.37"]
diff --git a/LayoutTests/svg/custom/use-transform.svg b/LayoutTests/svg/custom/use-transform.svg
new file mode 100644 (file)
index 0000000..36fa152
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="800" height="600" viewBox="0 0 400 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+    <g id="g" transform="rotate(-45 30 5)">
+        <rect stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
+        <circle opacity="0.5" fill="green" cx="30" cy="5" r="10"/>
+    </g>
+</defs>
+
+<g transform="translate(125 25)">
+    <g transform="rotate(40 30 5)"> 
+        <g transform="rotate(-45 30 5)">
+            <rect stroke-width="5px" fill="red" stroke="navy" width="60" height="10"/>
+            <circle opacity="0.5" fill="green" cx="30" cy="5" r="10"/>
+        </g>
+    </g>
+</g>
+
+<text x="10" y="60">The two objects should look identical.</text>
+
+<g transform="rotate(40 55 30)">
+<use x="25" y="25" xlink:href="#g"/>
+</g>
+
+</svg>
index 88ab99e..4ee529b 100644 (file)
@@ -1,3 +1,111 @@
+2007-01-19  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Eric.
+
+        Fixes: http://bugs.webkit.org/show_bug.cgi?id=10410 (SVG Slider example renders completely wrong (inserting <use> dynamically doesn't work))
+        Fixes: http://bugs.webkit.org/show_bug.cgi?id=11660 (SVG: creation of <use/> elements through scripting/DOM doesn't work)
+
+        Added test: svg/custom/use-instanceRoot-modifications.svg
+        Added test: svg/custom/use-on-g.svg
+        Added test: svg/custom/use-on-rect.svg
+        Added test: svg/custom/use-on-symbol-inside-pattern.svg
+        Added test: svg/custom/use-on-symbol.svg
+        Added test: svg/custom/use-on-text.svg
+        Added test: svg/custom/use-transform.svg
+
+        Fixes: svg/W3C-SVG-1.1/text-text-04-t.svg (missing use elements)
+        Fixes: svg/carto.net/button.svg (image buttons didn't appear)
+        Fixes: svg/carto.net/colourpicker.svg (slider handles finally show up)
+        Fixes: svg/carto.net/slider.svg (slider handles finally show up)
+        Fixes: svg/carto.net/window.svg (window decorations show up) 
+        Fixes: svg/custom/use-forward-refs.svg (missing use elements)
+
+        Rewrite <use> support with a real-shadow tree (as the spec demands), and implement SVGElementInstance.
+        AFAIK we're the first implementing this SVG feature - after ASV3 (!).
+
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/objc/DOMInternal.h:
+        * bindings/objc/DOMSVG.h:
+        * ksvg2/misc/SVGDocumentExtensions.cpp:
+        (WebCore::SVGDocumentExtensions::reportWarning):
+        (WebCore::SVGDocumentExtensions::reportError):
+        (WebCore::SVGDocumentExtensions::addPendingResource):
+        (WebCore::SVGDocumentExtensions::isPendingResource):
+        (WebCore::SVGDocumentExtensions::removePendingResource):
+        (WebCore::SVGDocumentExtensions::mapInstanceToElement):
+        (WebCore::SVGDocumentExtensions::removeInstanceMapping):
+        (WebCore::SVGDocumentExtensions::instancesForElement):
+        * ksvg2/misc/SVGDocumentExtensions.h:
+        * ksvg2/svg/SVGCircleElement.cpp:
+        (WebCore::SVGCircleElement::notifyAttributeChange):
+        * ksvg2/svg/SVGElement.cpp:
+        (WebCore::SVGElement::insertedIntoDocument):
+        * ksvg2/svg/SVGElement.h:
+        (WebCore::SVGElement::buildPendingResource):
+        * ksvg2/svg/SVGElementInstance.cpp:
+        (WebCore::SVGElementInstance::SVGElementInstance):
+        (WebCore::SVGElementInstance::~SVGElementInstance):
+        (WebCore::SVGElementInstance::clonedElement):
+        (WebCore::SVGElementInstance::correspondingElement):
+        (WebCore::SVGElementInstance::correspondingUseElement):
+        (WebCore::SVGElementInstance::parentNode):
+        (WebCore::SVGElementInstance::childNodes):
+        (WebCore::SVGElementInstance::previousSibling):
+        (WebCore::SVGElementInstance::nextSibling):
+        (WebCore::SVGElementInstance::firstChild):
+        (WebCore::SVGElementInstance::lastChild):
+        (WebCore::SVGElementInstance::appendChild):
+        (WebCore::SVGElementInstance::updateInstance):
+        * ksvg2/svg/SVGElementInstance.h:
+        * ksvg2/svg/SVGElementInstance.idl: Added.
+        * ksvg2/svg/SVGElementInstanceList.cpp:
+        (WebCore::SVGElementInstanceList::SVGElementInstanceList):
+        (WebCore::SVGElementInstanceList::length):
+        (WebCore::SVGElementInstanceList::item):
+        * ksvg2/svg/SVGElementInstanceList.h:
+        * ksvg2/svg/SVGElementInstanceList.idl: Added.
+        * ksvg2/svg/SVGEllipseElement.cpp:
+        (WebCore::SVGEllipseElement::notifyAttributeChange):
+        * ksvg2/svg/SVGGElement.cpp:
+        * ksvg2/svg/SVGGElement.h:
+        (WebCore::SVGGElement::contextElement):
+        * ksvg2/svg/SVGGradientElement.cpp:
+        * ksvg2/svg/SVGGradientElement.h:
+        * ksvg2/svg/SVGHiddenElement.h: Added.
+        (WebCore::SVGHiddenElement::Type):
+        (WebCore::SVGHiddenElement::~SVGHiddenElement):
+        (WebCore::SVGHiddenElement::localName):
+        * ksvg2/svg/SVGImageElement.cpp:
+        (WebCore::SVGImageElement::notifyAttributeChange):
+        * ksvg2/svg/SVGLineElement.cpp:
+        (WebCore::SVGLineElement::notifyAttributeChange):
+        * ksvg2/svg/SVGPathElement.cpp:
+        (WebCore::SVGPathElement::notifyAttributeChange):
+        * ksvg2/svg/SVGPatternElement.cpp:
+        * ksvg2/svg/SVGPatternElement.h:
+        * ksvg2/svg/SVGPolyElement.cpp:
+        (WebCore::SVGPolyElement::notifyAttributeChange):
+        * ksvg2/svg/SVGRectElement.cpp:
+        (WebCore::SVGRectElement::notifyAttributeChange):
+        * ksvg2/svg/SVGStyledElement.cpp:
+        (WebCore::SVGStyledElement::notifyAttributeChange):
+        (WebCore::SVGStyledElement::updateElementInstance):
+        * ksvg2/svg/SVGStyledElement.h:
+        * ksvg2/svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::instanceRoot):
+        (WebCore::SVGUseElement::animatedInstanceRoot):
+        (WebCore::SVGUseElement::hasChildNodes):
+        (WebCore::SVGUseElement::insertedIntoDocument):
+        (WebCore::SVGUseElement::buildPendingResource):
+        (WebCore::SVGUseElement::createRenderer):
+        (WebCore::SVGUseElement::buildShadowTree):
+        (WebCore::SVGUseElement::recursiveShadowTreeBuilder):
+        (WebCore::dumpShadowTree):
+        (WebCore::SVGUseElement::addShadowTree):
+        * ksvg2/svg/SVGUseElement.h:
+        * ksvg2/svg/SVGUseElement.idl:
+
 2007-01-19  Eric Seidel  <eric@webkit.org>
 
         Reviewed by rwlbuis.
index 82f3c31..cc70e56 100644 (file)
@@ -173,6 +173,8 @@ all : \
     DOMSVGDescElement.h \
     DOMSVGDocument.h \
     DOMSVGElement.h \
+    DOMSVGElementInstance.h \
+    DOMSVGElementInstanceList.h \
     DOMSVGEllipseElement.h \
     DOMSVGExternalResourcesRequired.h \
     DOMSVGFEBlendElement.h \
@@ -457,6 +459,8 @@ all : \
     JSSVGViewElement.h \
     JSSVGPreserveAspectRatio.h \
     JSSVGElement.h \
+    JSSVGElementInstance.h \
+    JSSVGElementInstanceList.h \
     JSSVGSVGElement.h \
     JSSVGEllipseElement.h \
     JSSVGFEBlendElement.h \
index 6b6b4c9..cfb0100 100644 (file)
                B2310B770B1F46A200D55D87 /* CgSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = B2310B740B1F46A200D55D87 /* CgSupport.h */; };
                B2310B780B1F46A300D55D87 /* RenderPathCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */; };
                B23BCCE50B3829C9005B2415 /* ImageBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B23BCCE40B3829C9005B2415 /* ImageBuffer.cpp */; };
+               B24055650B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */; };
+               B24055660B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */; };
                B25AE55F0B49D6630074C726 /* LinearGradientAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = B25AE55D0B49D6630074C726 /* LinearGradientAttributes.h */; };
                B25AE5600B49D6630074C726 /* RadialGradientAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = B25AE55E0B49D6630074C726 /* RadialGradientAttributes.h */; };
                B25DFAAF0B2E2929000E6510 /* JSSVGMatrixCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */; };
                B2C96D8D0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */; };
                B2CB41930AB75904004D9C45 /* SVGRenderingIntent.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB414C0AB75904004D9C45 /* SVGRenderingIntent.h */; };
                B2CB41A60AB75904004D9C45 /* SVGUnitTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB415F0AB75904004D9C45 /* SVGUnitTypes.h */; };
+               B2CB92420B5BD966009BAA78 /* JSSVGElementInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2CB923B0B5BD941009BAA78 /* JSSVGElementInstance.cpp */; };
+               B2CB92440B5BD970009BAA78 /* JSSVGElementInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB923C0B5BD941009BAA78 /* JSSVGElementInstance.h */; };
+               B2CB92460B5BD97B009BAA78 /* JSSVGElementInstanceList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2CB923D0B5BD941009BAA78 /* JSSVGElementInstanceList.cpp */; };
+               B2CB92480B5BD984009BAA78 /* JSSVGElementInstanceList.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB923E0B5BD941009BAA78 /* JSSVGElementInstanceList.h */; };
+               B2CB92610B5BDA02009BAA78 /* DOMSVGElementInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB925D0B5BDA02009BAA78 /* DOMSVGElementInstance.h */; };
+               B2CB92620B5BDA02009BAA78 /* DOMSVGElementInstance.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2CB925E0B5BDA02009BAA78 /* DOMSVGElementInstance.mm */; };
+               B2CB92630B5BDA02009BAA78 /* DOMSVGElementInstanceList.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB925F0B5BDA02009BAA78 /* DOMSVGElementInstanceList.h */; };
+               B2CB92640B5BDA02009BAA78 /* DOMSVGElementInstanceList.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2CB92600B5BDA02009BAA78 /* DOMSVGElementInstanceList.mm */; };
                B2D87C770B124E7300B0DE1E /* SVGPaintServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2D87C6B0B124E7300B0DE1E /* SVGPaintServer.cpp */; };
                B2D87C780B124E7300B0DE1E /* SVGPaintServer.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D87C6C0B124E7300B0DE1E /* SVGPaintServer.h */; };
                B2D87C790B124E7300B0DE1E /* SVGPaintServerGradient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2D87C6D0B124E7300B0DE1E /* SVGPaintServerGradient.cpp */; };
                B2D87C8A0B124E9500B0DE1E /* SVGPaintServerSolidCg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2D87C860B124E9500B0DE1E /* SVGPaintServerSolidCg.cpp */; };
                B2DDF0650B4829FA0064A4B1 /* PatternAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = B2DDF0640B4829FA0064A4B1 /* PatternAttributes.h */; };
                B2DDF0670B482A030064A4B1 /* GradientAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = B2DDF0660B482A030064A4B1 /* GradientAttributes.h */; };
+               B2DE281D0B5BFA5400CC289A /* SVGElementInstance.idl in Resources */ = {isa = PBXBuildFile; fileRef = B2DE281B0B5BFA5400CC289A /* SVGElementInstance.idl */; };
+               B2DE281E0B5BFA5400CC289A /* SVGElementInstanceList.idl in Resources */ = {isa = PBXBuildFile; fileRef = B2DE281C0B5BFA5400CC289A /* SVGElementInstanceList.idl */; };
                B2E27BD50B0F2A9500F17C7B /* SVGResourceFilterCg.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2E27BD30B0F2A9500F17C7B /* SVGResourceFilterCg.mm */; };
                B2E27BDA0B0F2AC800F17C7B /* SVGResourceFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2E27BD70B0F2AC800F17C7B /* SVGResourceFilter.cpp */; };
                B2E27BDB0B0F2AC800F17C7B /* SVGResourceFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E27BD80B0F2AC800F17C7B /* SVGResourceFilter.h */; };
                B2EBDC9C0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2EBDC9A0AF77E3400AE4A68 /* SVGRenderTreeAsText.cpp */; };
                B2EBDC9D0AF77E3400AE4A68 /* SVGRenderTreeAsText.h in Headers */ = {isa = PBXBuildFile; fileRef = B2EBDC9B0AF77E3400AE4A68 /* SVGRenderTreeAsText.h */; };
                B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */; };
+               B2F273F20B5BFAC50068C956 /* SVGElementInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F83D089701F300BA5114 /* SVGElementInstance.cpp */; };
+               B2F273F30B5BFAC80068C956 /* SVGElementInstanceList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8C0F83F089701F300BA5114 /* SVGElementInstanceList.cpp */; };
                B2FA3D360AB75A6F000E5AC4 /* JSSVGAnimateColorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */; };
                B2FA3D370AB75A6F000E5AC4 /* JSSVGAnimateColorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */; };
                B2FA3D380AB75A6F000E5AC4 /* JSSVGAnimatedAngle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C500AB75A6E000E5AC4 /* JSSVGAnimatedAngle.cpp */; };
                B2310B740B1F46A200D55D87 /* CgSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CgSupport.h; sourceTree = "<group>"; };
                B2310B750B1F46A200D55D87 /* RenderPathCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderPathCg.cpp; sourceTree = "<group>"; };
                B23BCCE40B3829C9005B2415 /* ImageBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBuffer.cpp; sourceTree = "<group>"; };
+               B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceInternal.h; sourceTree = "<group>"; };
+               B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceListInternal.h; sourceTree = "<group>"; };
                B25AE55D0B49D6630074C726 /* LinearGradientAttributes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LinearGradientAttributes.h; sourceTree = "<group>"; };
                B25AE55E0B49D6630074C726 /* RadialGradientAttributes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RadialGradientAttributes.h; sourceTree = "<group>"; };
                B25DFAAE0B2E2929000E6510 /* JSSVGMatrixCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGMatrixCustom.cpp; sourceTree = "<group>"; };
                B2CB41620AB75904004D9C45 /* SVGUseElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGUseElement.idl; sourceTree = "<group>"; };
                B2CB41630AB75904004D9C45 /* SVGViewElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGViewElement.idl; sourceTree = "<group>"; };
                B2CB41640AB75904004D9C45 /* SVGZoomAndPan.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGZoomAndPan.idl; sourceTree = "<group>"; };
+               B2CB923B0B5BD941009BAA78 /* JSSVGElementInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGElementInstance.cpp; sourceTree = "<group>"; };
+               B2CB923C0B5BD941009BAA78 /* JSSVGElementInstance.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGElementInstance.h; sourceTree = "<group>"; };
+               B2CB923D0B5BD941009BAA78 /* JSSVGElementInstanceList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGElementInstanceList.cpp; sourceTree = "<group>"; };
+               B2CB923E0B5BD941009BAA78 /* JSSVGElementInstanceList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGElementInstanceList.h; sourceTree = "<group>"; };
+               B2CB925D0B5BDA02009BAA78 /* DOMSVGElementInstance.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstance.h; sourceTree = "<group>"; };
+               B2CB925E0B5BDA02009BAA78 /* DOMSVGElementInstance.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMSVGElementInstance.mm; sourceTree = "<group>"; };
+               B2CB925F0B5BDA02009BAA78 /* DOMSVGElementInstanceList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMSVGElementInstanceList.h; sourceTree = "<group>"; };
+               B2CB92600B5BDA02009BAA78 /* DOMSVGElementInstanceList.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMSVGElementInstanceList.mm; sourceTree = "<group>"; };
                B2D87C6B0B124E7300B0DE1E /* SVGPaintServer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServer.cpp; sourceTree = "<group>"; };
                B2D87C6C0B124E7300B0DE1E /* SVGPaintServer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPaintServer.h; sourceTree = "<group>"; };
                B2D87C6D0B124E7300B0DE1E /* SVGPaintServerGradient.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServerGradient.cpp; sourceTree = "<group>"; };
                B2D87C860B124E9500B0DE1E /* SVGPaintServerSolidCg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPaintServerSolidCg.cpp; sourceTree = "<group>"; };
                B2DDF0640B4829FA0064A4B1 /* PatternAttributes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PatternAttributes.h; sourceTree = "<group>"; };
                B2DDF0660B482A030064A4B1 /* GradientAttributes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GradientAttributes.h; sourceTree = "<group>"; };
+               B2DE281B0B5BFA5400CC289A /* SVGElementInstance.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGElementInstance.idl; sourceTree = "<group>"; };
+               B2DE281C0B5BFA5400CC289A /* SVGElementInstanceList.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGElementInstanceList.idl; sourceTree = "<group>"; };
                B2E27BD30B0F2A9500F17C7B /* SVGResourceFilterCg.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SVGResourceFilterCg.mm; sourceTree = "<group>"; };
                B2E27BD70B0F2AC800F17C7B /* SVGResourceFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourceFilter.cpp; sourceTree = "<group>"; };
                B2E27BD80B0F2AC800F17C7B /* SVGResourceFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGResourceFilter.h; sourceTree = "<group>"; };
                                B2FA3C7D0AB75A6E000E5AC4 /* JSSVGDescElement.h */,
                                B2FA3C7E0AB75A6E000E5AC4 /* JSSVGDocument.cpp */,
                                B2FA3C7F0AB75A6E000E5AC4 /* JSSVGDocument.h */,
+                               B2CB923B0B5BD941009BAA78 /* JSSVGElementInstance.cpp */,
+                               B2CB923C0B5BD941009BAA78 /* JSSVGElementInstance.h */,
+                               B2CB923D0B5BD941009BAA78 /* JSSVGElementInstanceList.cpp */,
+                               B2CB923E0B5BD941009BAA78 /* JSSVGElementInstanceList.h */,
                                B2FA3C800AB75A6E000E5AC4 /* JSSVGEllipseElement.cpp */,
                                B2FA3C810AB75A6E000E5AC4 /* JSSVGEllipseElement.h */,
                                B2FA3C820AB75A6E000E5AC4 /* JSSVGFEBlendElement.cpp */,
                                85004D8D0ACEEAEF00C438F6 /* DOMSVGDocument.mm */,
                                854949100AC858D8008AB035 /* DOMSVGElement.h */,
                                854949110AC858D8008AB035 /* DOMSVGElement.mm */,
+                               B2CB925D0B5BDA02009BAA78 /* DOMSVGElementInstance.h */,
+                               B2CB925E0B5BDA02009BAA78 /* DOMSVGElementInstance.mm */,
+                               B2CB925F0B5BDA02009BAA78 /* DOMSVGElementInstanceList.h */,
+                               B2CB92600B5BDA02009BAA78 /* DOMSVGElementInstanceList.mm */,
                                85004D8E0ACEEAEF00C438F6 /* DOMSVGEllipseElement.h */,
                                85004D8F0ACEEAEF00C438F6 /* DOMSVGEllipseElement.mm */,
                                85D79ACF0ACA17EB00F02FC5 /* DOMSVGExternalResourcesRequired.h */,
                                85004D9F0ACEEB5A00C438F6 /* DOMSVGDescElementInternal.h */,
                                85004DA00ACEEB5A00C438F6 /* DOMSVGDocumentInternal.h */,
                                854949160AC85950008AB035 /* DOMSVGElementInternal.h */,
+                               B24055630B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h */,
+                               B24055640B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h */,
                                85004DA10ACEEB5A00C438F6 /* DOMSVGEllipseElementInternal.h */,
                                8502AB780AD4394E00378540 /* DOMSVGFEBlendElementInternal.h */,
                                8502AB790AD4394E00378540 /* DOMSVGFEColorMatrixElementInternal.h */,
                                A833C5E70A2CCBA400D57664 /* SVGElement.idl */,
                                A8C0F83D089701F300BA5114 /* SVGElementInstance.cpp */,
                                A8C0F83E089701F300BA5114 /* SVGElementInstance.h */,
+                               B2DE281B0B5BFA5400CC289A /* SVGElementInstance.idl */,
                                A8C0F83F089701F300BA5114 /* SVGElementInstanceList.cpp */,
                                A8C0F840089701F300BA5114 /* SVGElementInstanceList.h */,
+                               B2DE281C0B5BFA5400CC289A /* SVGElementInstanceList.idl */,
                                A8C0F841089701F300BA5114 /* SVGEllipseElement.cpp */,
                                A8C0F842089701F300BA5114 /* SVGEllipseElement.h */,
                                B2CB411D0AB758F4004D9C45 /* SVGEllipseElement.idl */,
                                510F73600B56C08800A3002A /* AuthenticationChallenge.h in Headers */,
                                510F73620B56C08800A3002A /* Credential.h in Headers */,
                                510F73640B56C08800A3002A /* ProtectionSpace.h in Headers */,
+                               B2CB92440B5BD970009BAA78 /* JSSVGElementInstance.h in Headers */,
+                               B2CB92480B5BD984009BAA78 /* JSSVGElementInstanceList.h in Headers */,
+                               B2CB92610B5BDA02009BAA78 /* DOMSVGElementInstance.h in Headers */,
+                               B2CB92630B5BDA02009BAA78 /* DOMSVGElementInstanceList.h in Headers */,
+                               B24055650B5BE640002A28C0 /* DOMSVGElementInstanceInternal.h in Headers */,
+                               B24055660B5BE640002A28C0 /* DOMSVGElementInstanceListInternal.h in Headers */,
                                1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */,
                                A80CEBAC0B60FC49007637C1 /* SVGMPathElement.h in Headers */,
                        );
                                B2E27C740B0F2AE600F17C7B /* WKTableTransferFilter.cikernel in Resources */,
                                4614A1FE0B23A8D600446E1C /* copyCursor.png in Resources */,
                                46BD16E30B279473001F0839 /* noneCursor.png in Resources */,
+                               B2DE281D0B5BFA5400CC289A /* SVGElementInstance.idl in Resources */,
+                               B2DE281E0B5BFA5400CC289A /* SVGElementInstanceList.idl in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                510F735F0B56C08800A3002A /* AuthenticationChallenge.cpp in Sources */,
                                510F73610B56C08800A3002A /* Credential.cpp in Sources */,
                                510F73630B56C08800A3002A /* ProtectionSpace.cpp in Sources */,
+                               B2CB92420B5BD966009BAA78 /* JSSVGElementInstance.cpp in Sources */,
+                               B2CB92460B5BD97B009BAA78 /* JSSVGElementInstanceList.cpp in Sources */,
+                               B2CB92620B5BDA02009BAA78 /* DOMSVGElementInstance.mm in Sources */,
+                               B2CB92640B5BDA02009BAA78 /* DOMSVGElementInstanceList.mm in Sources */,
+                               B2F273F20B5BFAC50068C956 /* SVGElementInstance.cpp in Sources */,
+                               B2F273F30B5BFAC80068C956 /* SVGElementInstanceList.cpp in Sources */,
                                1A2A68230B5BEDE70002A480 /* ProgressTracker.cpp in Sources */,
                                A80CEBAD0B60FC49007637C1 /* SVGMPathElement.cpp in Sources */,
                        );
index 5627687..afca027 100644 (file)
 #import "DOMSVGDescElementInternal.h"
 #import "DOMSVGDocumentInternal.h"
 #import "DOMSVGElementInternal.h"
+#import "DOMSVGElementInstanceInternal.h"
+#import "DOMSVGElementInstanceListInternal.h"
 #import "DOMSVGEllipseElementInternal.h"
 #import "DOMSVGFEBlendElementInternal.h"
 #import "DOMSVGFEColorMatrixElementInternal.h"
index 6d64bc5..840566a 100644 (file)
@@ -53,6 +53,8 @@
 #import <WebCore/DOMSVGDescElement.h>
 #import <WebCore/DOMSVGDocument.h>
 #import <WebCore/DOMSVGElement.h>
+#import <WebCore/DOMSVGElementInstance.h>
+#import <WebCore/DOMSVGElementInstanceList.h>
 #import <WebCore/DOMSVGEllipseElement.h>
 #import <WebCore/DOMSVGException.h>
 #import <WebCore/DOMSVGExternalResourcesRequired.h>
index dfba0df..14ea126 100644 (file)
@@ -94,25 +94,25 @@ void SVGDocumentExtensions::unpauseAnimations()
 
 void SVGDocumentExtensions::reportWarning(const String& message)
 {
-    if (Page* page = m_doc->frame()->page()) {
+    if (Page* page = m_doc->frame()->page())
         page->chrome()->addMessageToConsole("Warning: " + message, m_doc->tokenizer() ? m_doc->tokenizer()->lineNumber() : 1, String());
-    }
 }
 
 void SVGDocumentExtensions::reportError(const String& message)
 {
-    if (Page* page = m_doc->frame()->page()) {
+    if (Page* page = m_doc->frame()->page())
         page->chrome()->addMessageToConsole("Error: " + message, m_doc->tokenizer() ? m_doc->tokenizer()->lineNumber() : 1, String());
-    }
 }
 
 void SVGDocumentExtensions::addPendingResource(const AtomicString& id, SVGStyledElement* obj)
 {
+    ASSERT(obj);
+
     if (m_pendingResources.contains(id))
-        m_pendingResources.get(id).add(obj);
+        m_pendingResources.get(id)->add(obj);
     else {
-        HashSet<SVGStyledElement*> set;
-        set.add(obj);
+        HashSet<SVGStyledElement*>* set = new HashSet<SVGStyledElement*>();
+        set->add(obj);
 
         m_pendingResources.add(id, set);
     }
@@ -120,18 +120,52 @@ void SVGDocumentExtensions::addPendingResource(const AtomicString& id, SVGStyled
 
 bool SVGDocumentExtensions::isPendingResource(const AtomicString& id) const
 {
+    if (id.isEmpty())
+        return false;
+
     return m_pendingResources.contains(id);
 }
 
-HashSet<SVGStyledElement*> SVGDocumentExtensions::removePendingResource(const AtomicString& id)
+HashSet<SVGStyledElement*>* SVGDocumentExtensions::removePendingResource(const AtomicString& id)
 {
     ASSERT(m_pendingResources.contains(id));
 
-    HashSet<SVGStyledElement*> set = m_pendingResources.get(id);
+    HashSet<SVGStyledElement*>* set = m_pendingResources.get(id);
     m_pendingResources.remove(id);
     return set;
 }
 
+void SVGDocumentExtensions::mapInstanceToElement(SVGElementInstance* instance, SVGElement* element)
+{
+    ASSERT(instance);
+    ASSERT(element);
+
+    if (m_elementInstances.contains(element))
+        m_elementInstances.get(element)->add(instance);
+    else {
+        HashSet<SVGElementInstance*>* set = new HashSet<SVGElementInstance*>();;
+        set->add(instance);
+
+        m_elementInstances.add(element, set);
+    }
+}
+
+void SVGDocumentExtensions::removeInstanceMapping(SVGElementInstance* instance, SVGElement* element)
+{
+    ASSERT(instance);
+
+    if (!m_elementInstances.contains(element))
+        return;
+
+    m_elementInstances.get(element)->remove(instance);
+}
+
+HashSet<SVGElementInstance*>* SVGDocumentExtensions::instancesForElement(SVGElement* element) const
+{
+    ASSERT(element);
+    return m_elementInstances.get(element);
+}
+
 }
 
 #endif
index 7700685..4265920 100644 (file)
@@ -43,6 +43,7 @@ class Node;
 class SVGElement;
 class String;
 class TimeScheduler;
+class SVGElementInstance;
 class SVGStyledElement;
 class SVGSVGElement;
 
@@ -66,7 +67,8 @@ public:
 private:
     Document* m_doc; // weak reference
     HashSet<SVGSVGElement*> m_timeContainers; // For SVG 1.2 support this will need to be made more general.
-    HashMap<String, HashSet<SVGStyledElement*> > m_pendingResources;
+    HashMap<String, HashSet<SVGStyledElement*>*> m_pendingResources;
+    HashMap<SVGElement*, HashSet<SVGElementInstance*>*> m_elementInstances;
 
     SVGDocumentExtensions(const SVGDocumentExtensions&);
     SVGDocumentExtensions& operator=(const SVGDocumentExtensions&);
@@ -91,7 +93,13 @@ public:
     // For instance, dynamically build gradients / patterns / clippers...
     void addPendingResource(const AtomicString& id, SVGStyledElement*);
     bool isPendingResource(const AtomicString& id) const;
-    HashSet<SVGStyledElement*> removePendingResource(const AtomicString& id);
+    HashSet<SVGStyledElement*>* removePendingResource(const AtomicString& id);
+
+    // This HashMap maps elements to their instances, when they are used by <use> elements.
+    // This is needed to synchronize the original element with the internally cloned one.
+    void mapInstanceToElement(SVGElementInstance*, SVGElement*);
+    void removeInstanceMapping(SVGElementInstance*, SVGElement*);
+    HashSet<SVGElementInstance*>* instancesForElement(SVGElement*) const;
 
     // Used by the ANIMATED_PROPERTY_* macros
     template<typename ValueType>
index 353b1cd..c5b77cb 100644 (file)
@@ -75,6 +75,8 @@ void SVGCircleElement::notifyAttributeChange() const
 {
     if (!ownerDocument()->parsing())
         rebuildRenderer();
+
+    SVGStyledElement::notifyAttributeChange();
 }
 
 Path SVGCircleElement::toPathData() const
index 43ebed3..91be10b 100644 (file)
@@ -35,6 +35,7 @@
 #include "SVGDocumentExtensions.h"
 #include "SVGNames.h"
 #include "SVGSVGElement.h"
+#include "SVGURIReference.h"
 #include "XMLNames.h"
 
 namespace WebCore {
@@ -179,6 +180,27 @@ bool SVGElement::childShouldCreateRenderer(Node* child) const
     return false;
 }
 
+void SVGElement::insertedIntoDocument()
+{
+    StyledElement::insertedIntoDocument();
+    SVGDocumentExtensions* extensions = document()->accessSVGExtensions();
+
+    String resourceId = SVGURIReference::getTarget(id());
+    if (extensions->isPendingResource(resourceId)) {
+        HashSet<SVGStyledElement*>* clients = extensions->removePendingResource(resourceId);
+        if (!clients || clients->isEmpty())
+            return;
+
+        HashSet<SVGStyledElement*>::const_iterator it = clients->begin();
+        const HashSet<SVGStyledElement*>::const_iterator end = clients->end();
+
+        for (; it != end; ++it)
+            (*it)->buildPendingResource();
+
+        SVGResource::repaintClients(*clients);
+    }
+}
+
 }
 
 #endif // SVG_SUPPORT
index 78d21ba..01e9b9f 100644 (file)
@@ -211,6 +211,9 @@ namespace WebCore {
         virtual bool rendererIsNeeded(RenderStyle*) { return false; }
         virtual bool childShouldCreateRenderer(Node*) const;
 
+        virtual void insertedIntoDocument();
+        virtual void buildPendingResource() { }
+
         void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false);
 
         // Forwarded properties (declared/defined anywhere else in the inheritance structure)
index f3b2eb1..3193f6e 100644 (file)
@@ -1,6 +1,5 @@
 /*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005, 2006 Rob Buis <buis@kde.org>
+    Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
 
     This file is part of the KDE project
 
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGElementInstance.h"
 
 #include "SVGElementInstanceList.h"
 #include "SVGUseElement.h"
 
+#include <wtf/Assertions.h>
+
 namespace WebCore {
 
-SVGElementInstance::SVGElementInstance()
-    : EventTarget()
+SVGElementInstance::SVGElementInstance(PassRefPtr<SVGUseElement> useElement, PassRefPtr<SVGElement> clonedElement, PassRefPtr<SVGElement> originalElement)
+    : m_useElement(useElement)
+    , m_element(originalElement)
+    , m_clonedElement(clonedElement)
+    , m_previousSibling(0)
+    , m_nextSibling(0)
+    , m_firstChild(0)
+    , m_lastChild(0)
 {
+    ASSERT(m_useElement);
+    ASSERT(m_element);
+    ASSERT(m_clonedElement);
+
+    // Register as instance for passed element.
+    SVGDocumentExtensions* extensions = (m_element->document() ? m_element->document()->accessSVGExtensions() : 0);
+    if (extensions)
+        extensions->mapInstanceToElement(this, m_element.get());
 }
 
 SVGElementInstance::~SVGElementInstance()
 {
+    // Deregister as instance for passed element.
+    SVGDocumentExtensions* extensions = (m_element->document() ? m_element->document()->accessSVGExtensions() : 0);
+    if (extensions)
+        extensions->removeInstanceMapping(this, m_element.get());
+}
+
+SVGElement* SVGElementInstance::clonedElement() const
+{
+    return m_clonedElement.get();
 }
 
 SVGElement* SVGElementInstance::correspondingElement() const
 {
-    return 0;
+    return m_element.get();
 }
 
 SVGUseElement* SVGElementInstance::correspondingUseElement() const
 {
-    return 0;
+    return m_useElement.get();
 }
 
 SVGElementInstance* SVGElementInstance::parentNode() const
 {
-    return 0;
+    return parent();
 }
 
-SVGElementInstanceList* SVGElementInstance::childNodes() const
+PassRefPtr<SVGElementInstanceList> SVGElementInstance::childNodes()
 {
-    return 0;
+    return new SVGElementInstanceList(this);
 }
 
 SVGElementInstance* SVGElementInstance::previousSibling() const
 {
-    return 0;
+    return m_previousSibling;
 }
 
 SVGElementInstance* SVGElementInstance::nextSibling() const
 {
-    return 0;
+    return m_nextSibling;
 }
 
 SVGElementInstance* SVGElementInstance::firstChild() const
 {
-    return 0;
+    return m_firstChild;
 }
 
 SVGElementInstance* SVGElementInstance::lastChild() const
 {
-    return 0;
+    return m_lastChild;
+}
+
+void SVGElementInstance::appendChild(PassRefPtr<SVGElementInstance> child)
+{
+    child->setParent(this);
+
+    if (m_lastChild) {
+        child->m_previousSibling = m_lastChild;
+        m_lastChild->m_nextSibling = child.get();
+    } else
+        m_firstChild = child.get();
+
+    m_lastChild = child.get();
+}
+
+void SVGElementInstance::updateInstance(SVGElement* element)
+{
+    ASSERT(element == m_element);
+
+    RefPtr<Node> clone = m_element->cloneNode(false);
+    SVGElement* svgClone = svg_dynamic_cast(clone.get());
+    ASSERT(svgClone);
+
+    // Replace node in the hidden use tree.
+    ExceptionCode ec = 0;
+    m_clonedElement->parentNode()->replaceChild(clone, m_clonedElement.get(), ec);
+    ASSERT(ec == 0);
+
+    m_clonedElement = svgClone;
 }
 
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 12f5758..b70fe26 100644 (file)
@@ -1,6 +1,5 @@
 /*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005, 2006 Rob Buis <buis@kde.org>
+    Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
 
     This file is part of the KDE project
 
 
 #ifndef SVGElementInstance_h
 #define SVGElementInstance_h
+
 #ifdef SVG_SUPPORT
 
-#include "EventTarget.h"
+#include "Shared.h"
+
+#include <wtf/RefPtr.h>
+#include <wtf/PassRefPtr.h>
 
-namespace WebCore
-{
+namespace WebCore {
     class SVGElement;
     class SVGUseElement;
     class SVGElementInstanceList;
-    class SVGElementInstance : public EventTarget
-    {
+
+    class SVGElementInstance : public TreeShared<SVGElementInstance> {
     public:
-        SVGElementInstance();
+        SVGElementInstance(PassRefPtr<SVGUseElement>, PassRefPtr<SVGElement> clonedElement, PassRefPtr<SVGElement> originalElement);
         virtual ~SVGElementInstance();
 
         // 'SVGElementInstance' functions
@@ -42,11 +44,34 @@ namespace WebCore
         SVGUseElement* correspondingUseElement() const;
 
         SVGElementInstance* parentNode() const;
-        SVGElementInstanceList* childNodes() const;
+        PassRefPtr<SVGElementInstanceList> childNodes();
+
         SVGElementInstance* previousSibling() const;
         SVGElementInstance* nextSibling() const;
+
         SVGElementInstance* firstChild() const;
         SVGElementInstance* lastChild() const;
+
+        // Internal usage only!
+        SVGElement* clonedElement() const; 
+    private: // Helper methods
+        friend class SVGUseElement;
+        void appendChild(PassRefPtr<SVGElementInstance> child);
+
+        friend class SVGStyledElement;
+        void updateInstance(SVGElement*);
+
+    private:
+        RefPtr<SVGUseElement> m_useElement;
+        RefPtr<SVGElement> m_element;
+        RefPtr<SVGElement> m_clonedElement;
+
+        SVGElementInstance* m_previousSibling;
+        SVGElementInstance* m_nextSibling;
+
+        SVGElementInstance* m_firstChild;
+        SVGElementInstance* m_lastChild;
     };
 
 } // namespace WebCore
diff --git a/WebCore/ksvg2/svg/SVGElementInstance.idl b/WebCore/ksvg2/svg/SVGElementInstance.idl
new file mode 100644 (file)
index 0000000..96825d8
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+module svg {
+    interface [Conditional=SVG] SVGElementInstance {
+        readonly attribute SVGElement correspondingElement;
+        readonly attribute SVGUseElement correspondingUseElement;
+        readonly attribute SVGElementInstance parentNode;
+        readonly attribute SVGElementInstanceList childNodes;
+        readonly attribute SVGElementInstance firstChild;
+        readonly attribute SVGElementInstance lastChild;
+        readonly attribute SVGElementInstance previousSibling;
+        readonly attribute SVGElementInstance nextSibling;
+    };
+}
index f464106..c147166 100644 (file)
@@ -1,6 +1,5 @@
 /*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005, 2006 Rob Buis <buis@kde.org>
+    Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
 
     This file is part of the KDE project
 
@@ -27,8 +26,8 @@
 
 namespace WebCore {
 
-SVGElementInstanceList::SVGElementInstanceList()
-    : SVGList<RefPtr<SVGElementInstance> >()
+SVGElementInstanceList::SVGElementInstanceList(PassRefPtr<SVGElementInstance> rootInstance)
+    : m_rootInstance(rootInstance)
 {
 }
 
@@ -36,6 +35,30 @@ SVGElementInstanceList::~SVGElementInstanceList()
 {
 }
 
+unsigned int SVGElementInstanceList::length() const
+{
+    // NOTE: We could use the same caching facilities, "ChildNodeList" uses.
+    unsigned length = 0;
+    SVGElementInstance* instance;
+    for (instance = m_rootInstance->firstChild(); instance; instance = instance->nextSibling())
+        length++;
+
+    return length;
+}
+
+RefPtr<SVGElementInstance> SVGElementInstanceList::item(unsigned int index)
+{
+    unsigned int pos = 0;
+    SVGElementInstance* instance = m_rootInstance->firstChild();
+
+    while (instance && pos < index) {
+        instance = instance->nextSibling();
+        pos++;
+    }
+
+    return instance;
+}
+
 }
 
 #endif // SVG_SUPPORT
index b06bf14..4d38d04 100644 (file)
@@ -1,6 +1,5 @@
 /*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
-                  2004, 2005, 2006 Rob Buis <buis@kde.org>
+    Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
 
     This file is part of the KDE project
 
 
 #ifdef SVG_SUPPORT
 
+#include "Shared.h"
 #include "SVGElementInstance.h"
-#include "SVGList.h"
 
-namespace WebCore
-{
-    class SVGElementInstanceList : public SVGList<RefPtr<SVGElementInstance> >
-    {
+namespace WebCore {
+    class SVGElementInstanceList : public Shared<SVGElementInstanceList> {
     public:
-        SVGElementInstanceList();
+        SVGElementInstanceList(PassRefPtr<SVGElementInstance> rootInstance);
         virtual ~SVGElementInstanceList();
-    };
 
+        unsigned int length() const;
+        RefPtr<SVGElementInstance> item(unsigned int index);
+
+    private:
+        RefPtr<SVGElementInstance> m_rootInstance;
+    };
 } // namespace WebCore
 
 #endif // SVG_SUPPORT
diff --git a/WebCore/ksvg2/svg/SVGElementInstanceList.idl b/WebCore/ksvg2/svg/SVGElementInstanceList.idl
new file mode 100644 (file)
index 0000000..434ad19
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+module svg {
+    interface [Conditional=SVG] SVGElementInstanceList {
+        readonly attribute unsigned long length;
+
+        SVGElementInstance item(in unsigned long index);
+    };
+}
index a864e2b..5c511bd 100644 (file)
@@ -82,6 +82,8 @@ void SVGEllipseElement::notifyAttributeChange() const
 {
     if (!ownerDocument()->parsing())
         rebuildRenderer();
+
+    SVGStyledElement::notifyAttributeChange();
 }
 
 Path SVGEllipseElement::toPathData() const
index 4a8306d..023fb3a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+    Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005, 2006 Rob Buis <buis@kde.org>
 
     This file is part of the KDE project
@@ -21,6 +21,7 @@
 */
 
 #include "config.h"
+
 #ifdef SVG_SUPPORT
 #include "SVGGElement.h"
 
@@ -56,24 +57,8 @@ RenderObject* SVGGElement::createRenderer(RenderArena* arena, RenderStyle* style
     return new (arena) RenderSVGContainer(this);
 }
 
-// Helper class for <use> support
-SVGDummyElement::SVGDummyElement(const QualifiedName& tagName, Document* doc)
-    : SVGGElement(tagName, doc)
-    ,  m_localName("dummy")
-{
-}
-
-SVGDummyElement::~SVGDummyElement()
-{
-}
-
-const AtomicString& SVGDummyElement::localName() const
-{
-    return m_localName;
-}
-
 }
 
-// vim:ts=4:noet
 #endif // SVG_SUPPORT
 
+// vim:ts=4:noet
index 2bd0e57..48e711c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
+    Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005, 2006 Rob Buis <buis@kde.org>
 
     This file is part of the KDE project
@@ -22,6 +22,7 @@
 
 #ifndef SVGGElement_h
 #define SVGGElement_h
+
 #ifdef SVG_SUPPORT
 
 #include "SVGExternalResourcesRequired.h"
@@ -39,7 +40,7 @@ namespace WebCore
     public:
         SVGGElement(const QualifiedName&, Document*);
         virtual ~SVGGElement();
-        
+
         virtual bool isValid() const { return SVGTests::isValid(); }
 
         virtual void parseMappedAttribute(MappedAttribute*);
@@ -49,20 +50,9 @@ namespace WebCore
 
     protected:
         virtual const SVGElement* contextElement() const { return this; }
-    private:
-        ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired) 
-     };
 
-    class SVGDummyElement : public SVGGElement {
-    public:
-        SVGDummyElement(const QualifiedName&, Document*);
-        virtual ~SVGDummyElement();
-
-        // Derived from: 'Element'
-        virtual const AtomicString& localName() const;
     private:
-        AtomicString m_localName;
+        ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired) 
     };
 
 } // namespace WebCore
index c8267dc..82f7859 100644 (file)
@@ -133,16 +133,6 @@ Vector<SVGGradientStop> SVGGradientElement::buildStops() const
     return stops;
 }
 
-void SVGGradientElement::insertedIntoDocument()
-{
-    SVGElement::insertedIntoDocument();
-    SVGDocumentExtensions* extensions = document()->accessSVGExtensions();
-
-    String resourceId = SVGURIReference::getTarget(id());
-    if (extensions->isPendingResource(resourceId))
-        SVGResource::repaintClients(extensions->removePendingResource(resourceId));
-}
-
 void SVGGradientElement::childrenChanged()
 {
     notifyAttributeChange();
index 855ce47..11f1207 100644 (file)
@@ -54,7 +54,6 @@ namespace WebCore {
 
         virtual SVGResource* canvasResource();
 
-        virtual void insertedIntoDocument();
         virtual void childrenChanged();
 
     protected:
diff --git a/WebCore/ksvg2/svg/SVGHiddenElement.h b/WebCore/ksvg2/svg/SVGHiddenElement.h
new file mode 100644 (file)
index 0000000..0e0f993
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+    Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
+
+    This file is part of the KDE project
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+    Boston, MA 02111-1307, USA.
+*/
+
+#ifndef SVGHiddenElement_h
+#define SVGHiddenElement_h
+
+#ifdef SVG_SUPPORT
+
+namespace WebCore {
+    // Rather crude hack for <use> support. This class "hides" another SVGElement
+    // derived class from the DOM, by assigning an arbitary node name, to exclude
+    // it ie. from getElementsByTagName() operations.
+    template<typename Type>
+    class SVGHiddenElement : public Type {
+    public:
+        SVGHiddenElement<Type>(const QualifiedName& tagName, Document* document)
+            : Type(tagName, document)
+            , m_localName("webkitHiddenElement")
+        {
+        }
+
+        virtual ~SVGHiddenElement()
+        {
+        }
+
+        virtual const AtomicString& localName() const
+        {
+            return m_localName;
+        }
+    private:
+        AtomicString m_localName;
+   };
+
+} // namespace WebCore
+
+#endif // SVG_SUPPORT
+#endif
+
+// vim:ts=4:noet
index 148a089..cfbee74 100644 (file)
@@ -102,6 +102,8 @@ void SVGImageElement::notifyAttributeChange() const
 {
     if (!ownerDocument()->parsing())
         rebuildRenderer();
+
+    SVGStyledElement::notifyAttributeChange();
 }
 
 RenderObject* SVGImageElement::createRenderer(RenderArena* arena, RenderStyle* style)
index 505a1e8..368b2ba 100644 (file)
@@ -79,6 +79,8 @@ void SVGLineElement::notifyAttributeChange() const
 {
     if (!ownerDocument()->parsing())
         rebuildRenderer();
+
+    SVGStyledElement::notifyAttributeChange();
 }
 
 Path SVGLineElement::toPathData() const
index 8257b53..1e98e33 100644 (file)
@@ -293,6 +293,8 @@ void SVGPathElement::notifyAttributeChange() const
 {
     if (!ownerDocument()->parsing())
         rebuildRenderer();
+
+    SVGStyledElement::notifyAttributeChange();
 }
 
 SVGPathSegList* SVGPathElement::pathSegList() const
index 52237e9..cd1e91b 100644 (file)
@@ -209,16 +209,6 @@ SVGResource* SVGPatternElement::canvasResource()
     return m_resource.get();
 }
 
-void SVGPatternElement::insertedIntoDocument()
-{
-    SVGElement::insertedIntoDocument();
-    SVGDocumentExtensions* extensions = document()->accessSVGExtensions();
-
-    String resourceId = SVGURIReference::getTarget(id());
-    if (extensions->isPendingResource(resourceId))
-        SVGResource::repaintClients(extensions->removePendingResource(resourceId));
-}
-
 PatternAttributes SVGPatternElement::collectPatternProperties() const
 {
     PatternAttributes attributes;
index 5b548ac..7e61ea0 100644 (file)
@@ -58,16 +58,12 @@ namespace WebCore
         // 'SVGPatternElement' functions
         virtual void parseMappedAttribute(MappedAttribute*);
 
-        const SVGStyledElement* pushAttributeContext(const SVGStyledElement*);
-
         virtual void notifyAttributeChange() const;
 
         virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); }
         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
         virtual SVGResource* canvasResource();
 
-        virtual void insertedIntoDocument();
-
     protected:
         ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference, String, Href, href)
         ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired)
index 77c2f75..2b49fc2 100644 (file)
@@ -112,6 +112,8 @@ void SVGPolyElement::notifyAttributeChange() const
     }
 
     m_ignoreAttributeChanges = false;
+
+    SVGStyledElement::notifyAttributeChange();
 }
 
 }
index 4c35eb8..ed5e077 100644 (file)
@@ -92,6 +92,8 @@ void SVGRectElement::notifyAttributeChange() const
 {
     if (!ownerDocument()->parsing())
         rebuildRenderer();
+
+    SVGStyledElement::notifyAttributeChange();
 }
 
 Path SVGRectElement::toPathData() const
index 391931f..447921f 100644 (file)
@@ -34,6 +34,7 @@
 #include "RenderView.h"
 #include "RenderPath.h"
 #include "SVGElement.h"
+#include "SVGElementInstance.h"
 #include "SVGNames.h"
 #include "SVGRenderStyle.h"
 #include "SVGSVGElement.h"
@@ -180,7 +181,39 @@ void SVGStyledElement::parseMappedAttribute(MappedAttribute* attr)
 
 void SVGStyledElement::notifyAttributeChange() const
 {
-    // no-op
+    SVGDocumentExtensions* extensions = document()->accessSVGExtensions();
+    if (!extensions)
+        return;
+
+    // In case we're referenced by a <use> element, we have element instances registered
+    // to us in the SVGDocumentExtensions. If notifyAttributeChange() is called, we need
+    // to recursively update all children including ourselves.
+    updateElementInstance(extensions);
+}
+
+void SVGStyledElement::updateElementInstance(SVGDocumentExtensions* extensions) const
+{
+    SVGStyledElement* nonConstThis = const_cast<SVGStyledElement*>(this);
+    HashSet<SVGElementInstance*>* set = extensions->instancesForElement(nonConstThis);
+    if (!set || set->isEmpty())
+        return;
+
+    HashSet<SVGElementInstance*>::const_iterator it = set->begin();
+    const HashSet<SVGElementInstance*>::const_iterator end = set->end();
+
+    for (; it != end; ++it)
+        (*it)->updateInstance(nonConstThis);
+
+    if (hasChildNodes()) {
+        for (Node* child = firstChild(); child; child = child->nextSibling()) {
+            SVGElement* element = svg_dynamic_cast(child);
+            if (!element || !element->isStyled())
+                continue;
+
+            SVGStyledElement* styled = static_cast<SVGStyledElement*>(element);
+            styled->updateElementInstance(extensions);
+        }
+    }
 }
 
 void SVGStyledElement::attributeChanged(Attribute* attr, bool preserveDecls)
index a771834..16e56f4 100644 (file)
@@ -58,6 +58,8 @@ namespace WebCore {
         RenderView* view() const;
 
         virtual void notifyAttributeChange() const;
+        void updateElementInstance(SVGDocumentExtensions*) const;
+
         virtual void attributeChanged(Attribute*, bool preserveDecls = false);
 
     protected:
index 5074bf6..35c5128 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
+    Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005, 2006 Rob Buis <buis@kde.org>
 
     This file is part of the KDE project
 
 #include "config.h"
 
+// Debugging helper
+// #define DUMP_SHADOW_TREE
+
 #ifdef SVG_SUPPORT
 #include "SVGUseElement.h"
 
+#include "CString.h"
 #include "Document.h"
+#include "HTMLNames.h"
 #include "RenderSVGContainer.h"
+#include "SVGElementInstance.h"
+#include "SVGElementInstanceList.h"
 #include "SVGGElement.h"
+#include "SVGHiddenElement.h"
 #include "SVGLength.h"
 #include "SVGNames.h"
 #include "SVGPreserveAspectRatio.h"
@@ -58,6 +66,17 @@ ANIMATED_PROPERTY_DEFINITIONS(SVGUseElement, SVGLength, Length, length, Y, y, SV
 ANIMATED_PROPERTY_DEFINITIONS(SVGUseElement, SVGLength, Length, length, Width, width, SVGNames::widthAttr.localName(), m_width)
 ANIMATED_PROPERTY_DEFINITIONS(SVGUseElement, SVGLength, Length, length, Height, height, SVGNames::heightAttr.localName(), m_height)
 
+SVGElementInstance* SVGUseElement::instanceRoot() const
+{
+    return m_targetElementInstance.get();
+}
+
+SVGElementInstance* SVGUseElement::animatedInstanceRoot() const
+{
+    // FIXME: Implement me.
+    return 0;
+}
 void SVGUseElement::parseMappedAttribute(MappedAttribute* attr)
 {
     const AtomicString& value = attr->value();
@@ -87,77 +106,224 @@ void SVGUseElement::parseMappedAttribute(MappedAttribute* attr)
     }
 }
 
-void SVGUseElement::closeRenderer()
+bool SVGUseElement::hasChildNodes() const
 {
-    Element* targetElement = ownerDocument()->getElementById(SVGURIReference::getTarget(href()));
-    SVGElement* target = svg_dynamic_cast(targetElement);
-    if (!target) {
-        //document()->addForwardReference(this);
+    return false;
+}
+
+void SVGUseElement::insertedIntoDocument()
+{
+    SVGElement::insertedIntoDocument();
+
+    String id = SVGURIReference::getTarget(href());
+    Element* targetElement = ownerDocument()->getElementById(id);
+    if (!targetElement) {
+        document()->accessSVGExtensions()->addPendingResource(id, this);
         return;
     }
 
-    float _x = x().value(), _y = y().value();
-    float _w = width().value(), _h = height().value();
-    
-    String wString = String::number(_w);
-    String hString = String::number(_h);
-    
+    buildPendingResource();
+}
+
+void SVGUseElement::notifyAttributeChange() const
+{
+    if (!attached() || ownerDocument()->parsing())
+        return;
+
+fprintf(stderr, "NAC NAC NAC NAC HAMMER!!!!!\n");
+    const_cast<SVGUseElement*>(this)->buildPendingResource();
+}
+
+void SVGUseElement::buildPendingResource()
+{
+    removeChildren();
+
+    String id = SVGURIReference::getTarget(href());
+    Element* targetElement = ownerDocument()->getElementById(id); 
+    SVGElement* target = svg_dynamic_cast(targetElement);
+    ASSERT(target);
+
+    // Build shadow tree.
+    buildShadowTree(target);
+    ASSERT(m_targetElementInstance);
+
     ExceptionCode ec = 0;
-    String trans = String::format("translate(%f, %f)", _x, _y);
+    String widthString = String::number(width().value());
+    String heightString = String::number(height().value()); 
+    String transformString = String::format("translate(%f, %f)", x().value(), y().value());
+
+    // Spec: An additional transformation translate(x,y) is appended to the end
+    // (i.e., right-side) of the transform attribute on the generated 'g', where x
+    // and y represent the values of the x and y attributes on the 'use' element. 
+    RefPtr<SVGElement> gElement = new SVGHiddenElement<SVGGElement>(SVGNames::gTag, document());
+    gElement->setAttribute(SVGNames::transformAttr, transformString);
+
     if (target->hasTagName(SVGNames::symbolTag)) {
-        RefPtr<SVGElement> dummy = new SVGSVGElement(SVGNames::svgTag, document());
-        if (_w > 0)
-            dummy->setAttribute(SVGNames::widthAttr, wString);
-        if (_h > 0)
-            dummy->setAttribute(SVGNames::heightAttr, hString);
-        
-        SVGSymbolElement* symbol = static_cast<SVGSymbolElement*>(target);
-        if (symbol->hasAttribute(SVGNames::viewBoxAttr)) {
-            const AtomicString& symbolViewBox = symbol->getAttribute(SVGNames::viewBoxAttr);
-            dummy->setAttribute(SVGNames::viewBoxAttr, symbolViewBox);
-        }
-        target->cloneChildNodes(dummy.get());
-        *dummy->attributes() = *target->attributes();
-
-        RefPtr<SVGElement> dummy2 = new SVGDummyElement(SVGNames::gTag, document());
-        dummy2->setAttribute(SVGNames::transformAttr, trans);
-        
-        appendChild(dummy2, ec);
-        dummy2->appendChild(dummy, ec);
+        // Spec: The referenced 'symbol' and its contents are deep-cloned into the generated tree,
+        // with the exception that the 'symbol' is replaced by an 'svg'. This generated 'svg' will
+        // always have explicit values for attributes width and height. If attributes width and/or
+        // height are provided on the 'use' element, then these attributes will be transferred to
+        // the generated 'svg'. If attributes width and/or height are not specified, the generated
+        // 'svg' element will use values of 100% for these attributes.
+        RefPtr<SVGElement> svgElement = new SVGHiddenElement<SVGSVGElement>(SVGNames::svgTag, document());
+
+        // Transfer all attributes from <symbol> to the new <svg> element
+        *svgElement->attributes() = *target->attributes();
+
+        // Explicitely re-set width/height values
+        svgElement->setAttribute(SVGNames::widthAttr, hasAttribute(SVGNames::widthAttr) ? widthString : "100%");
+        svgElement->setAttribute(SVGNames::heightAttr, hasAttribute(SVGNames::heightAttr) ? heightString : "100%");
+
+        // IMPORTANT! Before inserted into the document, clear the id of the clone!
+        ExceptionCode ec = 0;    
+        svgElement->removeAttribute(HTMLNames::idAttr, ec);
+        ASSERT(ec == 0);
+
+        // Add all children of the <symbol> element to the new <svg> element
+        addShadowTree(svgElement.get(), true);
+
+        // Add new <svg> element to <g>
+        gElement->appendChild(svgElement.release(), ec);
+        ASSERT(ec == 0);
     } else if (target->hasTagName(SVGNames::svgTag)) {
-        RefPtr<SVGDummyElement> dummy = new SVGDummyElement(SVGNames::gTag, document());
-        dummy->setAttribute(SVGNames::transformAttr, trans);
-        
-        RefPtr<SVGElement> root = static_pointer_cast<SVGElement>(target->cloneNode(true));
+        SVGElement* element = m_targetElementInstance->clonedElement();
+        ASSERT(element->hasTagName(SVGNames::svgTag));
+
         if (hasAttribute(SVGNames::widthAttr))
-            root->setAttribute(SVGNames::widthAttr, wString);
-            
+            element->setAttribute(SVGNames::widthAttr, widthString);
         if (hasAttribute(SVGNames::heightAttr))
-            root->setAttribute(SVGNames::heightAttr, hString);
-            
-        appendChild(dummy, ec);
-        dummy->appendChild(root.release(), ec);
-    } else {
-        RefPtr<SVGDummyElement> dummy = new SVGDummyElement(SVGNames::gTag, document());
-        dummy->setAttribute(SVGNames::transformAttr, trans);
-        
-        RefPtr<Node> root = target->cloneNode(true);
-        
-        appendChild(dummy, ec);
-        dummy->appendChild(root.release(), ec);
-    }
+            element->setAttribute(SVGNames::heightAttr, heightString);
+        addShadowTree(gElement.get());
+    } else
+        addShadowTree(gElement.get());
 
-    SVGElement::closeRenderer();
+    // FIXME: The SVGHiddenElement class will go away, as well as our removeAttribute(idAttr) trickery,
+    // when we move to using real shadowTree nodes like the form controls do
+    appendChild(gElement.release(), ec);
+    ASSERT(ec == 0);
 }
 
-bool SVGUseElement::hasChildNodes() const
+RenderObject* SVGUseElement::createRenderer(RenderArena* arena, RenderStyle*)
 {
-    return false;
+    return new (arena) RenderSVGContainer(this);
 }
 
-RenderObject* SVGUseElement::createRenderer(RenderArena* arena, RenderStyle*)
+void SVGUseElement::buildShadowTree(SVGElement* target)
 {
-    return new (arena) RenderSVGContainer(this);
+    // Clone whole target sub-tree
+    RefPtr<Node> clone = target->cloneNode(true);
+    SVGElement* svgClone = svg_dynamic_cast(clone.get());
+    ASSERT(svgClone);
+
+    // IMPORTANT! Before inserted into the document, clear the id of the clone!
+    ExceptionCode ec = 0;    
+    svgClone->removeAttribute(HTMLNames::idAttr, ec);
+    ASSERT(ec == 0);
+
+    // Create root SVGElementInstance object for the first sub-tree node.
+    //
+    // Spec: If the 'use' element references a simple graphics element such as a 'rect', then there is only a
+    // single SVGElementInstance object, and the correspondingElement attribute on this SVGElementInstance object
+    // is the SVGRectElement that corresponds to the referenced 'rect' element.
+    m_targetElementInstance = new SVGElementInstance(this, svgClone, target);
+
+    // Eventually enter recursion to build SVGElementInstance objects for the sub-tree children
+    recursiveShadowTreeBuilder(target, svgClone, m_targetElementInstance.get());
+}
+
+void SVGUseElement::recursiveShadowTreeBuilder(SVGElement* target, SVGElement* clonedTarget, SVGElementInstance* targetInstance)
+{
+    ASSERT(target);
+    ASSERT(clonedTarget);
+    ASSERT(targetInstance);
+
+    // A general description from the SVG spec, describing what recursiveShadowTreeBuilder() actually does.
+    //
+    // Spec: If the 'use' element references a 'g' which contains two 'rect' elements, then the instance tree
+    // contains three SVGElementInstance objects, a root SVGElementInstance object whose correspondingElement
+    // is the SVGGElement object for the 'g', and then two child SVGElementInstance objects, each of which has
+    // its correspondingElement that is an SVGRectElement object.
+
+    // FIXME: Complex deep references. (only simple forward references work)
+    // If the referenced object is itself a 'use', or if there are 'use' subelements within the referenced
+    // object, the instance tree will contain recursive expansion of the indirect references to form a complete tree.
+    Node* node = target->firstChild();
+    for (Node* clonedNode = clonedTarget->firstChild(); clonedNode; clonedNode = clonedNode->nextSibling()) {
+        SVGElement* element = svg_dynamic_cast(node);
+        SVGElement* clonedElement = svg_dynamic_cast(clonedNode);
+
+        // Skip any non-svg nodes.
+        if (!element || !clonedElement) {
+            if (node)
+                node = node->nextSibling();
+
+            continue;
+        }
+
+        // IMPORTANT! Before inserted into the document, clear the id of the clone!
+        ExceptionCode ec = 0;
+        clonedElement->removeAttribute(HTMLNames::idAttr, ec);
+        ASSERT(ec == 0);
+
+        // Create SVGElementInstance object, for both container/non-container nodes.
+        SVGElementInstance* instance = new SVGElementInstance(this, clonedElement, element);
+        targetInstance->appendChild(instance);
+
+        // Enter recursion, adding shadow tree nodes to "instance" as target.
+        if (clonedElement->hasChildNodes())
+            recursiveShadowTreeBuilder(clonedElement, element, instance);
+
+        node = node->nextSibling();
+    }
+}
+
+#ifdef DUMP_SHADOW_TREE
+void dumpShadowTree(unsigned int& depth, String& text, SVGElementInstance* targetInstance)
+{
+    SVGElement* element = targetInstance->clonedElement();
+    ASSERT(element);
+
+    String elementNodeName = element->nodeName();
+    String parentNodeName = element->parentNode() ? element->parentNode()->nodeName() : "null";
+    String firstChildNodeName = element->firstChild() ? element->firstChild()->nodeName() : "null";
+
+    for (unsigned int i = 0; i < depth; ++i)
+        text += "  ";
+
+    text += String::format("SVGElementInstance (parentNode=%s, firstChild=%s, correspondingElement=%s)\n",
+                           parentNodeName.latin1().data(), firstChildNodeName.latin1().data(), elementNodeName.latin1().data());
+    depth++;
+
+    for (SVGElementInstance* instance = targetInstance->firstChild(); instance; instance = instance->nextSibling())
+        dumpShadowTree(depth, text, instance);
+
+    depth--;
+}
+#endif
+
+void SVGUseElement::addShadowTree(SVGElement* target, bool onlyAddChildren)
+{
+    ASSERT(m_targetElementInstance && m_targetElementInstance->correspondingUseElement() == this);
+
+#ifdef DUMP_SHADOW_TREE
+    unsigned int depth = 0; String text;
+    dumpShadowTree(depth, text, m_targetElementInstance.get());
+    fprintf(stderr, "Dumping <use> shadow tree:\n%s\n", text.latin1().data());
+#endif
+
+    ExceptionCode ec = 0;
+
+    if (onlyAddChildren) {
+        for (SVGElementInstance* instance = m_targetElementInstance->firstChild(); instance; instance = instance->nextSibling()) {
+            target->appendChild(instance->clonedElement(), ec);
+            ASSERT(ec == 0);
+        }
+    } else {
+        target->appendChild(m_targetElementInstance->clonedElement(), ec);
+        ASSERT(ec == 0);
+    }
 }
 
 }
index e15a2d4..13f2c95 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <wildfox@kde.org>
+    Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
                   2004, 2005, 2006 Rob Buis <buis@kde.org>
 
     This file is part of the KDE project
@@ -33,7 +33,9 @@
 
 namespace WebCore
 {
+    class SVGElementInstance;
     class SVGLength;
+
     class SVGUseElement : public SVGStyledTransformableElement,
                           public SVGTests,
                           public SVGLangSpace,
@@ -43,16 +45,20 @@ namespace WebCore
     public:
         SVGUseElement(const QualifiedName&, Document*);
         virtual ~SVGUseElement();
-        
+
+        SVGElementInstance* instanceRoot() const;
+        SVGElementInstance* animatedInstanceRoot() const;
+
         virtual bool isValid() const { return SVGTests::isValid(); }
 
         // Derived from: 'Element'
         virtual bool hasChildNodes() const;
-
-        virtual void closeRenderer();
+        virtual void insertedIntoDocument();
+        virtual void buildPendingResource();
 
         // 'SVGUseElement' functions
         virtual void parseMappedAttribute(MappedAttribute*);
+        virtual void notifyAttributeChange() const;
 
         virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); }
         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
@@ -68,6 +74,13 @@ namespace WebCore
         ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGLength, SVGLength, Y, y)
         ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGLength, SVGLength, Width, width)
         ANIMATED_PROPERTY_DECLARATIONS(SVGUseElement, SVGLength, SVGLength, Height, height)
+
+    private:
+        void recursiveShadowTreeBuilder(SVGElement* target, SVGElement* clonedTarget, SVGElementInstance* targetInstance);
+        void buildShadowTree(SVGElement* target);
+        void addShadowTree(SVGElement* target, bool onlyAddChildren = false);
+
+        RefPtr<SVGElementInstance> m_targetElementInstance;
     };
 
 } // namespace WebCore
@@ -76,3 +89,4 @@ namespace WebCore
 #endif
 
 // vim:ts=4:noet
+
index 93e07e9..0b3652d 100644 (file)
@@ -36,9 +36,9 @@ module svg {
         readonly attribute SVGAnimatedLength   y;
         readonly attribute SVGAnimatedLength   width;
         readonly attribute SVGAnimatedLength   height;
-    
-        // TODO    readonly attribute SVGElementInstance instanceRoot;
-        // TODO    readonly attribute SVGElementInstance animatedInstanceRoot;
+
+        readonly attribute SVGElementInstance instanceRoot;
+        readonly attribute SVGElementInstance animatedInstanceRoot;
     };
 
 }