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 requestAnimationFrame(createPatterns); |
13 } | 13 } |
14 | 14 |
15 function createPatterns() | 15 function createPatterns() |
16 { | 16 { |
17 // Setup "fillPattern" | 17 // Setup "fillPattern" |
18 var pattern1 = document.createElementNS("http://www.w3.org/2000/svg", "p
attern"); | 18 var pattern1 = document.createElementNS("http://www.w3.org/2000/svg", "p
attern"); |
19 pattern1.setAttribute("id", "fillPattern"); | 19 pattern1.setAttribute("id", "fillPattern"); |
20 pattern1.setAttribute("patternUnits", "userSpaceOnUse"); | 20 pattern1.setAttribute("patternUnits", "userSpaceOnUse"); |
21 pattern1.setAttribute("x", "0"); | 21 pattern1.setAttribute("x", "0"); |
22 pattern1.setAttribute("y", "0"); | 22 pattern1.setAttribute("y", "0"); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 rect22.setAttribute("y", "10"); | 63 rect22.setAttribute("y", "10"); |
64 rect22.setAttribute("width", "10"); | 64 rect22.setAttribute("width", "10"); |
65 rect22.setAttribute("height", "10"); | 65 rect22.setAttribute("height", "10"); |
66 rect22.setAttribute("fill", "blue"); | 66 rect22.setAttribute("fill", "blue"); |
67 | 67 |
68 pattern2.appendChild(rect12); | 68 pattern2.appendChild(rect12); |
69 pattern2.appendChild(rect22); | 69 pattern2.appendChild(rect22); |
70 | 70 |
71 content.appendChild(pattern2); | 71 content.appendChild(pattern2); |
72 | 72 |
73 setTimeout(setupPatternUsers, 0); | 73 requestAnimationFrame(setupPatternUsers); |
74 } | 74 } |
75 | 75 |
76 function setupPatternUsers() | 76 function setupPatternUsers() |
77 { | 77 { |
78 var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text
"); | 78 var text1 = document.createElementNS("http://www.w3.org/2000/svg", "text
"); |
79 text1.setAttribute("font-size", "68"); | 79 text1.setAttribute("font-size", "68"); |
80 text1.setAttribute("x", "-150"); | 80 text1.setAttribute("x", "-150"); |
81 text1.setAttribute("y", "70") | 81 text1.setAttribute("y", "70") |
82 text1.setAttribute("fill", "url(#fillPattern)"); | 82 text1.setAttribute("fill", "url(#fillPattern)"); |
83 text1.setAttribute("stroke", "none"); | 83 text1.setAttribute("stroke", "none"); |
(...skipping 19 matching lines...) Expand all Loading... |
103 text3.setAttribute("stroke", "url(#strokePattern)"); | 103 text3.setAttribute("stroke", "url(#strokePattern)"); |
104 text3.appendChild(document.createTextNode("Pattern on fill/stroke")); | 104 text3.appendChild(document.createTextNode("Pattern on fill/stroke")); |
105 | 105 |
106 content.appendChild(text3); | 106 content.appendChild(text3); |
107 | 107 |
108 finishRepaintTest(); | 108 finishRepaintTest(); |
109 } | 109 } |
110 </script> | 110 </script> |
111 | 111 |
112 </svg> | 112 </svg> |
OLD | NEW |