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
+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.
--- /dev/null
+fb567eabc81dc687eb7fa4458be0fbbe
\ No newline at end of file
--- /dev/null
+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"]
--- /dev/null
+<?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>
--- /dev/null
+be1eb841f86d65c4e0d2897d142fcc44
\ No newline at end of file
--- /dev/null
+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"]
--- /dev/null
+<?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>
--- /dev/null
+fb567eabc81dc687eb7fa4458be0fbbe
\ No newline at end of file
--- /dev/null
+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"]
--- /dev/null
+<?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>
--- /dev/null
+fb567eabc81dc687eb7fa4458be0fbbe
\ No newline at end of file
--- /dev/null
+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"]
--- /dev/null
+<?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>
--- /dev/null
+aea1184881eb65a8f688ab03abcf0b30
\ No newline at end of file
--- /dev/null
+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"]
--- /dev/null
+<?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>
+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.
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);
context->restore();
m_cachedBounds = transform.mapRect(m_marker->getAbsoluteRepaintRect());
+
+ currentlyDrawingMarkers.remove(this);
}
FloatRect SVGResourceMarker::cachedBounds() const