LayoutTests:
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Feb 2007 07:19:11 +0000 (07:19 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Feb 2007 07:19:11 +0000 (07:19 +0000)
        Reviewed by Oliver.

        - test cases for <rdar://problem/4946881> Recursive loop with <marker> not caught, crashes in WebCore::SVGPaintServer::draw (11244)
        http://bugs.webkit.org/show_bug.cgi?id=11244

        * svg/custom/circular-marker-reference-1-expected.checksum: Added.
        * svg/custom/circular-marker-reference-1-expected.png: Added.
        * svg/custom/circular-marker-reference-1-expected.txt: Added.
        * svg/custom/circular-marker-reference-1.svg: Added.
        * svg/custom/circular-marker-reference-2-expected.checksum: Added.
        * svg/custom/circular-marker-reference-2-expected.png: Added.
        * svg/custom/circular-marker-reference-2-expected.txt: Added.
        * svg/custom/circular-marker-reference-2.svg: Added.
        * svg/custom/circular-marker-reference-3-expected.checksum: Added.
        * svg/custom/circular-marker-reference-3-expected.png: Added.
        * svg/custom/circular-marker-reference-3-expected.txt: Added.
        * svg/custom/circular-marker-reference-3.svg: Added.
        * svg/custom/circular-marker-reference-4-expected.checksum: Added.
        * svg/custom/circular-marker-reference-4-expected.png: Added.
        * svg/custom/circular-marker-reference-4-expected.txt: Added.
        * svg/custom/circular-marker-reference-4.svg: Added.
        * svg/custom/non-circular-marker-reference-expected.checksum: Added.
        * svg/custom/non-circular-marker-reference-expected.png: Added.
        * svg/custom/non-circular-marker-reference-expected.txt: Added.
        * svg/custom/non-circular-marker-reference.svg: Added.

WebCore:

        Reviewed by Oliver.

        - fixed <rdar://problem/4946881> Recursive loop with <marker> not caught, crashes in WebCore::SVGPaintServer::draw (11244)
        http://bugs.webkit.org/show_bug.cgi?id=11244

        * platform/graphics/svg/SVGResourceMarker.cpp:
        (WebCore::SVGResourceMarker::draw): Use a HashSet to guard against
        reference cycles.

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

23 files changed:
LayoutTests/ChangeLog
LayoutTests/svg/custom/circular-marker-reference-1-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-1-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-1-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-1.svg [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-2-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-2-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-2-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-2.svg [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-3-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-3-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-3-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-3.svg [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-4-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-4-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-4-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/circular-marker-reference-4.svg [new file with mode: 0644]
LayoutTests/svg/custom/non-circular-marker-reference-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/non-circular-marker-reference-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/non-circular-marker-reference-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/non-circular-marker-reference.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/graphics/svg/SVGResourceMarker.cpp

index f65f352210892e345edbb61c9aff857e6170839a..973e0f768f70c6d935fc93e6fe43729a8c0bdbf6 100644 (file)
@@ -1,3 +1,31 @@
+2007-02-26  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Oliver.
+
+        - test cases for <rdar://problem/4946881> Recursive loop with <marker> not caught, crashes in WebCore::SVGPaintServer::draw (11244)
+        http://bugs.webkit.org/show_bug.cgi?id=11244
+
+        * svg/custom/circular-marker-reference-1-expected.checksum: Added.
+        * svg/custom/circular-marker-reference-1-expected.png: Added.
+        * svg/custom/circular-marker-reference-1-expected.txt: Added.
+        * svg/custom/circular-marker-reference-1.svg: Added.
+        * svg/custom/circular-marker-reference-2-expected.checksum: Added.
+        * svg/custom/circular-marker-reference-2-expected.png: Added.
+        * svg/custom/circular-marker-reference-2-expected.txt: Added.
+        * svg/custom/circular-marker-reference-2.svg: Added.
+        * svg/custom/circular-marker-reference-3-expected.checksum: Added.
+        * svg/custom/circular-marker-reference-3-expected.png: Added.
+        * svg/custom/circular-marker-reference-3-expected.txt: Added.
+        * svg/custom/circular-marker-reference-3.svg: Added.
+        * svg/custom/circular-marker-reference-4-expected.checksum: Added.
+        * svg/custom/circular-marker-reference-4-expected.png: Added.
+        * svg/custom/circular-marker-reference-4-expected.txt: Added.
+        * svg/custom/circular-marker-reference-4.svg: Added.
+        * svg/custom/non-circular-marker-reference-expected.checksum: Added.
+        * svg/custom/non-circular-marker-reference-expected.png: Added.
+        * svg/custom/non-circular-marker-reference-expected.txt: Added.
+        * svg/custom/non-circular-marker-reference.svg: Added.
+
 2007-02-26  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Antti Koivisto.
diff --git a/LayoutTests/svg/custom/circular-marker-reference-1-expected.checksum b/LayoutTests/svg/custom/circular-marker-reference-1-expected.checksum
new file mode 100644 (file)
index 0000000..9a9d903
--- /dev/null
@@ -0,0 +1 @@
+fb567eabc81dc687eb7fa4458be0fbbe
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/circular-marker-reference-1-expected.png b/LayoutTests/svg/custom/circular-marker-reference-1-expected.png
new file mode 100644 (file)
index 0000000..c3ae06d
Binary files /dev/null and b/LayoutTests/svg/custom/circular-marker-reference-1-expected.png differ
diff --git a/LayoutTests/svg/custom/circular-marker-reference-1-expected.txt b/LayoutTests/svg/custom/circular-marker-reference-1-expected.txt
new file mode 100644 (file)
index 0000000..8c7e31f
--- /dev/null
@@ -0,0 +1,8 @@
+KCanvasResource {id="mark" [type=MARKER] [angle=0.00] [ref x=4.00 y=4.00]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (235,345) size 330x30
+      RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+        RenderSVGContainer {marker} at (-2.06,-0.94) size 4.12x0.38
+          RenderPath {path} at (-2.06,-0.94) size 4.12x0.38 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark] [middle marker=#mark] [end marker=#mark] [data="M-5.00,-2.00L0.00,-2.00L5.00,-2.00"]
+      RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark] [middle marker=#mark] [end marker=#mark] [data="M-5.00,2.00L0.00,2.00L5.00,2.00"]
diff --git a/LayoutTests/svg/custom/circular-marker-reference-1.svg b/LayoutTests/svg/custom/circular-marker-reference-1.svg
new file mode 100644 (file)
index 0000000..8deecec
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -10 20 20"
+  stroke="#000" stroke-linecap="round"
+  >
+
+  <defs>
+    <marker id="mark" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="3" markerHeight="3">
+  <path marker-start="url(#mark)" marker-mid="url(#mark)" marker-end="url(#mark)" d="M-5,-2h5h5"/>
+    </marker>
+  </defs>
+
+  <path d="M-5,+2h5h5"
+    marker-start="url(#mark)" marker-mid="url(#mark)" marker-end="url(#mark)"/>
+
+</svg>
diff --git a/LayoutTests/svg/custom/circular-marker-reference-2-expected.checksum b/LayoutTests/svg/custom/circular-marker-reference-2-expected.checksum
new file mode 100644 (file)
index 0000000..7f4a901
--- /dev/null
@@ -0,0 +1 @@
+be1eb841f86d65c4e0d2897d142fcc44
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/circular-marker-reference-2-expected.png b/LayoutTests/svg/custom/circular-marker-reference-2-expected.png
new file mode 100644 (file)
index 0000000..7c12ae8
Binary files /dev/null and b/LayoutTests/svg/custom/circular-marker-reference-2-expected.png differ
diff --git a/LayoutTests/svg/custom/circular-marker-reference-2-expected.txt b/LayoutTests/svg/custom/circular-marker-reference-2-expected.txt
new file mode 100644 (file)
index 0000000..c8acf60
--- /dev/null
@@ -0,0 +1,9 @@
+KCanvasResource {id="mark" [type=MARKER] [angle=0.00] [ref x=4.00 y=4.00]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (235,225) size 330x150 [start marker=#mark] [middle marker=#mark] [end marker=#mark]
+      RenderSVGHiddenContainer {defs} at (0,0) size 0x0 [start marker=#mark] [middle marker=#mark] [end marker=#mark]
+        RenderSVGContainer {marker} at (0.19,0.19) size 2.62x2.62 [start marker=#mark] [middle marker=#mark] [end marker=#mark]
+          RenderPath {circle} at (0.19,0.19) size 2.62x2.62 [stroke={[type=SOLID] [color=#FF0000] [line cap=ROUND]}] [start marker=#mark] [middle marker=#mark] [end marker=#mark] [data="M7.00,4.00L6.99,4.19L6.98,4.38L6.95,4.56L6.91,4.75L6.85,4.93L6.79,5.10L6.71,5.28L6.63,5.45L6.53,5.61L6.43,5.76L6.31,5.91L6.19,6.05L6.05,6.19L5.91,6.31L5.76,6.43L5.61,6.53L5.45,6.63L5.28,6.71L5.10,6.79L4.93,6.85L4.75,6.91L4.56,6.95L4.38,6.98L4.19,6.99L4.00,7.00L3.81,6.99L3.62,6.98L3.44,6.95L3.25,6.91L3.07,6.85L2.90,6.79L2.72,6.71L2.55,6.63L2.39,6.53L2.24,6.43L2.09,6.31L1.95,6.19L1.81,6.05L1.69,5.91L1.57,5.76L1.47,5.61L1.37,5.45L1.29,5.28L1.21,5.10L1.15,4.93L1.09,4.75L1.05,4.56L1.02,4.38L1.01,4.19L1.00,4.00L1.01,3.81L1.02,3.62L1.05,3.44L1.09,3.25L1.15,3.07L1.21,2.90L1.29,2.72L1.37,2.55L1.47,2.39L1.57,2.24L1.69,2.09L1.81,1.95L1.95,1.81L2.09,1.69L2.24,1.57L2.39,1.47L2.55,1.37L2.72,1.29L2.90,1.21L3.07,1.15L3.25,1.09L3.44,1.05L3.62,1.02L3.81,1.01L4.00,1.00L4.19,1.01L4.38,1.02L4.56,1.05L4.75,1.09L4.93,1.15L5.10,1.21L5.28,1.29L5.45,1.37L5.61,1.47L5.76,1.57L5.91,1.69L6.05,1.81L6.19,1.95L6.31,2.09L6.43,2.24L6.53,2.39L6.63,2.55L6.71,2.72L6.79,2.90L6.85,3.07L6.91,3.25L6.95,3.44L6.98,3.62L6.99,3.81"]
+      RenderPath {path} at (235,225) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark] [middle marker=#mark] [end marker=#mark] [data="M-5.00,-2.00L0.00,-2.00L5.00,-2.00"]
+      RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark] [middle marker=#mark] [end marker=#mark] [data="M-5.00,2.00L0.00,2.00L5.00,2.00"]
diff --git a/LayoutTests/svg/custom/circular-marker-reference-2.svg b/LayoutTests/svg/custom/circular-marker-reference-2.svg
new file mode 100644 (file)
index 0000000..dad0f53
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -10 20 20"
+  stroke="#000" stroke-linecap="round"
+  marker-start="url(#mark)" marker-mid="url(#mark)" marker-end="url(#mark)">
+
+  <defs>
+    <marker id="mark" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="3" markerHeight="3">
+      <circle cx="4" cy="4" r="3" stroke="#f00" fill="none"/>
+    </marker>
+  </defs>
+
+  <path d="M-5,-2h5h5"/>
+  <path d="M-5,+2h5h5"
+    marker-start="url(#mark)" marker-mid="url(#mark)" marker-end="url(#mark)"/>
+
+</svg>
diff --git a/LayoutTests/svg/custom/circular-marker-reference-3-expected.checksum b/LayoutTests/svg/custom/circular-marker-reference-3-expected.checksum
new file mode 100644 (file)
index 0000000..9a9d903
--- /dev/null
@@ -0,0 +1 @@
+fb567eabc81dc687eb7fa4458be0fbbe
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/circular-marker-reference-3-expected.png b/LayoutTests/svg/custom/circular-marker-reference-3-expected.png
new file mode 100644 (file)
index 0000000..c3ae06d
Binary files /dev/null and b/LayoutTests/svg/custom/circular-marker-reference-3-expected.png differ
diff --git a/LayoutTests/svg/custom/circular-marker-reference-3-expected.txt b/LayoutTests/svg/custom/circular-marker-reference-3-expected.txt
new file mode 100644 (file)
index 0000000..b84455c
--- /dev/null
@@ -0,0 +1,8 @@
+KCanvasResource {id="mark" [type=MARKER] [angle=0.00] [ref x=4.00 y=4.00]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (235,345) size 330x30 [start marker=#mark] [middle marker=#mark] [end marker=#mark]
+      RenderSVGHiddenContainer {defs} at (0,0) size 0x0 [start marker=#mark] [middle marker=#mark] [end marker=#mark]
+        RenderSVGContainer {marker} at (-2.06,-0.94) size 4.12x0.38 [start marker=#mark] [middle marker=#mark] [end marker=#mark]
+          RenderPath {path} at (-2.06,-0.94) size 4.12x0.38 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark] [middle marker=#mark] [end marker=#mark] [data="M-5.00,-2.00L0.00,-2.00L5.00,-2.00"]
+      RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark] [middle marker=#mark] [end marker=#mark] [data="M-5.00,2.00L0.00,2.00L5.00,2.00"]
diff --git a/LayoutTests/svg/custom/circular-marker-reference-3.svg b/LayoutTests/svg/custom/circular-marker-reference-3.svg
new file mode 100644 (file)
index 0000000..0c6cf04
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -10 20 20"
+  stroke="#000" stroke-linecap="round"
+  marker-start="url(#mark)" marker-mid="url(#mark)" marker-end="url(#mark)">
+
+  <defs>
+    <marker id="mark" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="3" markerHeight="3">
+  <path d="M-5,-2h5h5"/>
+    </marker>
+  </defs>
+
+  <path d="M-5,+2h5h5"
+    marker-start="url(#mark)" marker-mid="url(#mark)" marker-end="url(#mark)"/>
+
+</svg>
diff --git a/LayoutTests/svg/custom/circular-marker-reference-4-expected.checksum b/LayoutTests/svg/custom/circular-marker-reference-4-expected.checksum
new file mode 100644 (file)
index 0000000..9a9d903
--- /dev/null
@@ -0,0 +1 @@
+fb567eabc81dc687eb7fa4458be0fbbe
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/circular-marker-reference-4-expected.png b/LayoutTests/svg/custom/circular-marker-reference-4-expected.png
new file mode 100644 (file)
index 0000000..c3ae06d
Binary files /dev/null and b/LayoutTests/svg/custom/circular-marker-reference-4-expected.png differ
diff --git a/LayoutTests/svg/custom/circular-marker-reference-4-expected.txt b/LayoutTests/svg/custom/circular-marker-reference-4-expected.txt
new file mode 100644 (file)
index 0000000..d7c0454
--- /dev/null
@@ -0,0 +1,10 @@
+KCanvasResource {id="mark1" [type=MARKER] [angle=0.00] [ref x=4.00 y=4.00]}
+KCanvasResource {id="mark2" [type=MARKER] [angle=0.00] [ref x=4.00 y=4.00]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (235,225) size 330x150
+      RenderSVGContainer {marker} at (338.12,271.88) size 123.75x11.25
+        RenderPath {path} at (338.12,271.88) size 123.75x11.25 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark2] [middle marker=#mark2] [end marker=#mark2] [data="M-5.00,-2.00L0.00,-2.00L5.00,-2.00"]
+      RenderSVGContainer {marker} at (338.12,316.88) size 123.75x11.25
+        RenderPath {path} at (338.12,316.88) size 123.75x11.25 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark1] [middle marker=#mark1] [end marker=#mark1] [data="M-5.00,2.00L0.00,2.00L5.00,2.00"]
+      RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark1] [middle marker=#mark1] [end marker=#mark1] [data="M-5.00,2.00L0.00,2.00L5.00,2.00"]
diff --git a/LayoutTests/svg/custom/circular-marker-reference-4.svg b/LayoutTests/svg/custom/circular-marker-reference-4.svg
new file mode 100644 (file)
index 0000000..04fcb34
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -10 20 20"
+  stroke="#000" stroke-linecap="round"
+  >
+
+  <marker id="mark1" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="3" markerHeight="3">
+  <path d="M-5,-2h5h5" marker-start="url(#mark2)" marker-mid="url(#mark2)" marker-end="url(#mark2)"/>
+    </marker>
+
+
+  <marker id="mark2" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="3" markerHeight="3">
+  <path d="M-5,+2h5h5"
+    marker-start="url(#mark1)" marker-mid="url(#mark1)" marker-end="url(#mark1)"/>
+   </marker>
+
+  <path d="M-5,+2h5h5"
+    marker-start="url(#mark1)" marker-mid="url(#mark1)" marker-end="url(#mark1)"/>
+
+</svg>
diff --git a/LayoutTests/svg/custom/non-circular-marker-reference-expected.checksum b/LayoutTests/svg/custom/non-circular-marker-reference-expected.checksum
new file mode 100644 (file)
index 0000000..76dafd3
--- /dev/null
@@ -0,0 +1 @@
+aea1184881eb65a8f688ab03abcf0b30
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/non-circular-marker-reference-expected.png b/LayoutTests/svg/custom/non-circular-marker-reference-expected.png
new file mode 100644 (file)
index 0000000..b2f3ea1
Binary files /dev/null and b/LayoutTests/svg/custom/non-circular-marker-reference-expected.png differ
diff --git a/LayoutTests/svg/custom/non-circular-marker-reference-expected.txt b/LayoutTests/svg/custom/non-circular-marker-reference-expected.txt
new file mode 100644 (file)
index 0000000..0501b6f
--- /dev/null
@@ -0,0 +1,9 @@
+KCanvasResource {id="mark" [type=MARKER] [angle=0.00] [ref x=4.00 y=4.00]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (235,225) size 330x150
+      RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+        RenderSVGContainer {marker} at (0.19,0.19) size 2.62x2.62
+          RenderPath {circle} at (0.19,0.19) size 2.62x2.62 [stroke={[type=SOLID] [color=#FF0000] [line cap=ROUND]}] [data="M7.00,4.00L6.99,4.19L6.98,4.38L6.95,4.56L6.91,4.75L6.85,4.93L6.79,5.10L6.71,5.28L6.63,5.45L6.53,5.61L6.43,5.76L6.31,5.91L6.19,6.05L6.05,6.19L5.91,6.31L5.76,6.43L5.61,6.53L5.45,6.63L5.28,6.71L5.10,6.79L4.93,6.85L4.75,6.91L4.56,6.95L4.38,6.98L4.19,6.99L4.00,7.00L3.81,6.99L3.62,6.98L3.44,6.95L3.25,6.91L3.07,6.85L2.90,6.79L2.72,6.71L2.55,6.63L2.39,6.53L2.24,6.43L2.09,6.31L1.95,6.19L1.81,6.05L1.69,5.91L1.57,5.76L1.47,5.61L1.37,5.45L1.29,5.28L1.21,5.10L1.15,4.93L1.09,4.75L1.05,4.56L1.02,4.38L1.01,4.19L1.00,4.00L1.01,3.81L1.02,3.62L1.05,3.44L1.09,3.25L1.15,3.07L1.21,2.90L1.29,2.72L1.37,2.55L1.47,2.39L1.57,2.24L1.69,2.09L1.81,1.95L1.95,1.81L2.09,1.69L2.24,1.57L2.39,1.47L2.55,1.37L2.72,1.29L2.90,1.21L3.07,1.15L3.25,1.09L3.44,1.05L3.62,1.02L3.81,1.01L4.00,1.00L4.19,1.01L4.38,1.02L4.56,1.05L4.75,1.09L4.93,1.15L5.10,1.21L5.28,1.29L5.45,1.37L5.61,1.47L5.76,1.57L5.91,1.69L6.05,1.81L6.19,1.95L6.31,2.09L6.43,2.24L6.53,2.39L6.63,2.55L6.71,2.72L6.79,2.90L6.85,3.07L6.91,3.25L6.95,3.44L6.98,3.62L6.99,3.81"]
+      RenderPath {path} at (235,225) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [data="M-5.00,-2.00L0.00,-2.00L5.00,-2.00"]
+      RenderPath {path} at (235,345) size 330x30 [stroke={[type=SOLID] [color=#000000] [line cap=ROUND]}] [fill={[type=SOLID] [color=#000000]}] [start marker=#mark] [middle marker=#mark] [end marker=#mark] [data="M-5.00,2.00L0.00,2.00L5.00,2.00"]
diff --git a/LayoutTests/svg/custom/non-circular-marker-reference.svg b/LayoutTests/svg/custom/non-circular-marker-reference.svg
new file mode 100644 (file)
index 0000000..3fff35b
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="-10 -10 20 20"
+  stroke="#000" stroke-linecap="round">
+
+  <defs>
+    <marker id="mark" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="3" markerHeight="3">
+      <circle cx="4" cy="4" r="3" stroke="#ff0000" fill="none"/>
+    </marker>
+  </defs>
+
+  <path d="M-5,-2h5h5"/>
+  <path d="M-5,+2h5h5"
+    marker-start="url(#mark)" marker-mid="url(#mark)" marker-end="url(#mark)"/>
+
+</svg>
index f79ad9660df1541a221a4b684c5ce2c884b9f8ec..77043cd042d38de7958e6ceca988fd91641c7bb4 100644 (file)
@@ -1,3 +1,14 @@
+2007-02-26  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Oliver.
+
+        - fixed <rdar://problem/4946881> Recursive loop with <marker> not caught, crashes in WebCore::SVGPaintServer::draw (11244)
+        http://bugs.webkit.org/show_bug.cgi?id=11244
+
+        * platform/graphics/svg/SVGResourceMarker.cpp:
+        (WebCore::SVGResourceMarker::draw): Use a HashSet to guard against
+        reference cycles.
+
 2007-02-26  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Kevin McCullough.
index 4da8ea34b9191f06fcdb2fee7f811ef8987715f2..e6cf2658c6850506906ef09c36070917cda7b1d3 100644 (file)
@@ -65,6 +65,14 @@ void SVGResourceMarker::draw(GraphicsContext* context, const FloatRect& rect, do
     if (!m_marker)
         return;
 
+    static HashSet<SVGResourceMarker*> currentlyDrawingMarkers;
+
+    // avoid drawing circular marker references
+    if (currentlyDrawingMarkers.contains(this))
+        return;
+
+    currentlyDrawingMarkers.add(this);
+
     AffineTransform transform;
     transform.translate(x, y);
     transform.rotate(m_angle > -1 ? m_angle : angle);
@@ -95,6 +103,8 @@ void SVGResourceMarker::draw(GraphicsContext* context, const FloatRect& rect, do
     context->restore();
 
     m_cachedBounds = transform.mapRect(m_marker->getAbsoluteRepaintRect());
+
+    currentlyDrawingMarkers.remove(this);
 }
 
 FloatRect SVGResourceMarker::cachedBounds() const