OLD | NEW |
1 <?xml version="1.0" encoding="UTF-8"?> | 1 <?xml version="1.0" encoding="UTF-8"?> |
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics
/SVG/1.1/DTD/svg11-basic.dtd"> | 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics
/SVG/1.1/DTD/svg11-basic.dtd"> |
3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin
k" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="runRe
paintAndPixelTest()"> | 3 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin
k" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" onload="runRe
paintAndPixelTest()"> |
4 <script xlink:href="../../fast/repaint/resources/text-based-repaint.js"/> | 4 <script xlink:href="../../fast/repaint/resources/text-based-repaint.js"/> |
5 <defs id="defs"> | 5 <defs id="defs"> |
6 <marker id="markerStart" viewBox="0 0 10 10" markerWidth="2" markerHeight="2
" refX="5" refY="5" markerUnits="strokeWidth"> | 6 <marker id="markerStart" viewBox="0 0 10 10" markerWidth="2" markerHeight="2
" refX="5" refY="5" markerUnits="strokeWidth"> |
7 <rect width="10" height="10" fill="red" stroke="none"/> | 7 <rect width="10" height="10" fill="red" stroke="none"/> |
8 </marker> | 8 </marker> |
9 <marker id="markerEnd" viewBox="0 0 10 10" markerWidth="2" markerHeight="2"
refX="5" refY="5" markerUnits="strokeWidth"> | 9 <marker id="markerEnd" viewBox="0 0 10 10" markerWidth="2" markerHeight="2"
refX="5" refY="5" markerUnits="strokeWidth"> |
10 <path d="M 5 0 L 10 10 L 0 10 Z" fill="blue" stroke="none"/> | 10 <path d="M 5 0 L 10 10 L 0 10 Z" fill="blue" stroke="none"/> |
11 </marker> | 11 </marker> |
12 </defs> | 12 </defs> |
13 | 13 |
14 <g id="content"/> | 14 <g id="content"/> |
15 | 15 |
16 <script> | 16 <script> |
17 window.testIsAsync = true; | 17 window.testIsAsync = true; |
18 var defs = document.getElementById("defs"); | 18 var defs = document.getElementById("defs"); |
19 var content = document.getElementById("content"); | 19 var content = document.getElementById("content"); |
20 | 20 |
21 function repaintTest() { | 21 function repaintTest() { |
22 setTimeout(createObject, 0); | 22 // FIXME: we need a better way of waiting for layout/repainting to happe
n |
| 23 setTimeout(createObject, 1); |
23 } | 24 } |
24 | 25 |
25 function createObject() | 26 function createObject() |
26 { | 27 { |
27 var path = document.createElementNS("http://www.w3.org/2000/svg", "path"
); | 28 var path = document.createElementNS("http://www.w3.org/2000/svg", "path"
); |
28 path.setAttribute("fill", "none"); | 29 path.setAttribute("fill", "none"); |
29 path.setAttribute("stroke", "black"); | 30 path.setAttribute("stroke", "black"); |
30 path.setAttribute("stroke-width", "8"); | 31 path.setAttribute("stroke-width", "8"); |
31 path.setAttribute("marker-start", "url(#markerStart)"); | 32 path.setAttribute("marker-start", "url(#markerStart)"); |
32 path.setAttribute("marker-mid", "url(#markerMiddle)"); | 33 path.setAttribute("marker-mid", "url(#markerMiddle)"); |
33 path.setAttribute("marker-end", "url(#markerEnd)"); | 34 path.setAttribute("marker-end", "url(#markerEnd)"); |
34 path.setAttribute("d", "M 130 135 L 180 135 L 180 185"); | 35 path.setAttribute("d", "M 130 135 L 180 135 L 180 185"); |
35 | 36 |
36 content.appendChild(path); | 37 content.appendChild(path); |
37 setTimeout(createMarker, 0); | 38 // FIXME: we need a better way of waiting for layout/repainting to happe
n |
| 39 setTimeout(createMarker, 1); |
38 } | 40 } |
39 | 41 |
40 function createMarker() | 42 function createMarker() |
41 { | 43 { |
42 var marker = document.createElementNS("http://www.w3.org/2000/svg", "mar
ker"); | 44 var marker = document.createElementNS("http://www.w3.org/2000/svg", "mar
ker"); |
43 marker.setAttribute("id", "markerMiddle"); | 45 marker.setAttribute("id", "markerMiddle"); |
44 marker.setAttribute("viewBox", "0 0 10 10"); | 46 marker.setAttribute("viewBox", "0 0 10 10"); |
45 marker.setAttribute("markerWidth", "2"); | 47 marker.setAttribute("markerWidth", "2"); |
46 marker.setAttribute("markerHeight", "2"); | 48 marker.setAttribute("markerHeight", "2"); |
47 marker.setAttribute("refX", "5"); | 49 marker.setAttribute("refX", "5"); |
48 marker.setAttribute("refY", "5"); | 50 marker.setAttribute("refY", "5"); |
49 marker.setAttribute("markerUnits", "strokeWidth"); | 51 marker.setAttribute("markerUnits", "strokeWidth"); |
50 | 52 |
51 var circle = document.createElementNS("http://www.w3.org/2000/svg", "cir
cle"); | 53 var circle = document.createElementNS("http://www.w3.org/2000/svg", "cir
cle"); |
52 circle.setAttribute("cx", "5"); | 54 circle.setAttribute("cx", "5"); |
53 circle.setAttribute("cy", "5"); | 55 circle.setAttribute("cy", "5"); |
54 circle.setAttribute("r", "5"); | 56 circle.setAttribute("r", "5"); |
55 circle.setAttribute("fill", "green"); | 57 circle.setAttribute("fill", "green"); |
56 circle.setAttribute("stroke", "none"); | 58 circle.setAttribute("stroke", "none"); |
57 | 59 |
58 marker.appendChild(circle); | 60 marker.appendChild(circle); |
59 defs.appendChild(marker); | 61 defs.appendChild(marker); |
60 | 62 |
61 finishRepaintTest(); | 63 finishRepaintTest(); |
62 } | 64 } |
63 </script> | 65 </script> |
64 | 66 |
65 </svg> | 67 </svg> |
OLD | NEW |