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