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" transform="scale(1, 1.5)"> | 5 <g id="content" transform="scale(1, 1.5)"> |
6 <text font-size="68" fill="url(#dynPattern)" x="20" y="70">Pattern on fill
</text> | 6 <text font-size="68" fill="url(#dynPattern)" x="20" y="70">Pattern on fill
</text> |
7 </g> | 7 </g> |
8 <script> | 8 <script> |
9 window.testIsAsync = true; | 9 window.testIsAsync = true; |
10 var content = document.getElementById("content"); | 10 var content = document.getElementById("content"); |
11 | 11 |
12 function repaintTest() { | 12 function repaintTest() { |
13 setTimeout(createPattern, 0); | 13 requestAnimationFrame(createPattern); |
14 } | 14 } |
15 | 15 |
16 function createPattern() | 16 function createPattern() |
17 { | 17 { |
18 var pattern = document.createElementNS("http://www.w3.org/2000/svg", "pa
ttern"); | 18 var pattern = document.createElementNS("http://www.w3.org/2000/svg", "pa
ttern"); |
19 pattern.setAttribute("id", "dynPattern"); | 19 pattern.setAttribute("id", "dynPattern"); |
20 pattern.setAttribute("patternUnits", "userSpaceOnUse"); | 20 pattern.setAttribute("patternUnits", "userSpaceOnUse"); |
21 pattern.setAttribute("x", "0"); | 21 pattern.setAttribute("x", "0"); |
22 pattern.setAttribute("y", "0"); | 22 pattern.setAttribute("y", "0"); |
23 pattern.setAttribute("width", "20"); | 23 pattern.setAttribute("width", "20"); |
(...skipping 16 matching lines...) Expand all Loading... |
40 pattern.appendChild(rect1); | 40 pattern.appendChild(rect1); |
41 pattern.appendChild(rect2); | 41 pattern.appendChild(rect2); |
42 | 42 |
43 content.appendChild(pattern); | 43 content.appendChild(pattern); |
44 | 44 |
45 finishRepaintTest(); | 45 finishRepaintTest(); |
46 } | 46 } |
47 </script> | 47 </script> |
48 | 48 |
49 </svg> | 49 </svg> |
OLD | NEW |