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 <g id="content"/> | 5 <g id="content"/> |
6 | 6 |
7 <script> | 7 <script> |
8 window.testIsAsync = true; | 8 window.testIsAsync = true; |
9 var content = document.getElementById("content"); | 9 var content = document.getElementById("content"); |
10 | 10 |
11 function repaintTest() { | 11 function repaintTest() { |
12 setTimeout(createPatterns, 0); | 12 // FIXME: we need a better way of waiting for layout/repainting to happe
n |
| 13 setTimeout(createPatterns, 1); |
13 } | 14 } |
14 | 15 |
15 function createPatterns() | 16 function createPatterns() |
16 { | 17 { |
17 // Setup "fillPattern" | 18 // Setup "fillPattern" |
18 var pattern1 = document.createElementNS("http://www.w3.org/2000/svg", "p
attern"); | 19 var pattern1 = document.createElementNS("http://www.w3.org/2000/svg", "p
attern"); |
19 pattern1.setAttribute("id", "fillPattern"); | 20 pattern1.setAttribute("id", "fillPattern"); |
20 pattern1.setAttribute("patternUnits", "userSpaceOnUse"); | 21 pattern1.setAttribute("patternUnits", "userSpaceOnUse"); |
21 pattern1.setAttribute("x", "0"); | 22 pattern1.setAttribute("x", "0"); |
22 pattern1.setAttribute("y", "0"); | 23 pattern1.setAttribute("y", "0"); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 rect22.setAttribute("y", "10"); | 64 rect22.setAttribute("y", "10"); |
64 rect22.setAttribute("width", "10"); | 65 rect22.setAttribute("width", "10"); |
65 rect22.setAttribute("height", "10"); | 66 rect22.setAttribute("height", "10"); |
66 rect22.setAttribute("fill", "blue"); | 67 rect22.setAttribute("fill", "blue"); |
67 | 68 |
68 pattern2.appendChild(rect12); | 69 pattern2.appendChild(rect12); |
69 pattern2.appendChild(rect22); | 70 pattern2.appendChild(rect22); |
70 | 71 |
71 content.appendChild(pattern2); | 72 content.appendChild(pattern2); |
72 | 73 |
73 setTimeout(setupPatternUsers, 0); | 74 // FIXME: we need a better way of waiting for layout/repainting to happe
n |
| 75 setTimeout(setupPatternUsers, 1); |
74 } | 76 } |
75 | 77 |
76 function setupPatternUsers() | 78 function setupPatternUsers() |
77 { | 79 { |
78 var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text
"); | 80 var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text
"); |
79 text1.setAttribute("font-size", "68"); | 81 text1.setAttribute("font-size", "68"); |
80 text1.setAttribute("x", "-150"); | 82 text1.setAttribute("x", "-150"); |
81 text1.setAttribute("y", "70") | 83 text1.setAttribute("y", "70") |
82 text1.setAttribute("fill", "url(#fillPattern)"); | 84 text1.setAttribute("fill", "url(#fillPattern)"); |
83 text1.setAttribute("stroke", "none"); | 85 text1.setAttribute("stroke", "none"); |
(...skipping 19 matching lines...) Expand all Loading... |
103 text3.setAttribute("stroke", "url(#strokePattern)"); | 105 text3.setAttribute("stroke", "url(#strokePattern)"); |
104 text3.appendChild(document.createTextNode("Pattern on fill/stroke")); | 106 text3.appendChild(document.createTextNode("Pattern on fill/stroke")); |
105 | 107 |
106 content.appendChild(text3); | 108 content.appendChild(text3); |
107 | 109 |
108 finishRepaintTest(); | 110 finishRepaintTest(); |
109 } | 111 } |
110 </script> | 112 </script> |
111 | 113 |
112 </svg> | 114 </svg> |
OLD | NEW |