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 <script> | 6 <script> |
| 7 window.testIsAsync = true; |
| 8 function repaintTest() { |
| 9 runAfterDisplay(createObject); |
| 10 } |
| 11 |
7 var content = document.getElementById("content"); | 12 var content = document.getElementById("content"); |
8 function repaintTest() { | |
9 if (window.testRunner) | |
10 testRunner.waitUntilDone(); | |
11 setTimeout(createObject, 0); | |
12 } | |
13 | 13 |
14 function createObject() | 14 function createObject() |
15 { | 15 { |
16 var text = document.createElementNS("http://www.w3.org/2000/svg", "text"
); | 16 var text = document.createElementNS("http://www.w3.org/2000/svg", "text"
); |
17 text.setAttribute("font-size", "60"); | 17 text.setAttribute("font-size", "60"); |
18 text.setAttribute("fill", "navy"); | 18 text.setAttribute("fill", "navy"); |
19 text.setAttribute("clip-path", "url(#dynClip)"); | 19 text.setAttribute("clip-path", "url(#dynClip)"); |
20 text.setAttribute("x", "10"); | 20 text.setAttribute("x", "10"); |
21 text.setAttribute("y", "70"); | 21 text.setAttribute("y", "70"); |
22 | 22 |
23 text.appendChild(document.createTextNode("Clipped. INVISIBLE."));
| 23 text.appendChild(document.createTextNode("Clipped. INVISIBLE."));
|
24 content.appendChild(text); | 24 content.appendChild(text); |
25 | 25 |
26 setTimeout(createClipPath, 0); | 26 runAfterDisplay(createClipPath); |
27 } | 27 } |
28 | 28 |
29 function createClipPath() | 29 function createClipPath() |
30 { | 30 { |
31 var clipPath = document.createElementNS("http://www.w3.org/2000/svg", "c
lipPath"); | 31 var clipPath = document.createElementNS("http://www.w3.org/2000/svg", "c
lipPath"); |
32 clipPath.setAttribute("id", "dynClip"); | 32 clipPath.setAttribute("id", "dynClip"); |
33 clipPath.setAttribute("clipPathUnits", "userSpaceOnUse"); | 33 clipPath.setAttribute("clipPathUnits", "userSpaceOnUse"); |
34 | 34 |
35 var path = document.createElementNS("http://www.w3.org/2000/svg", "path"
); | 35 var path = document.createElementNS("http://www.w3.org/2000/svg", "path"
); |
36 path.setAttribute("d", "M 0 0 l 200 0 l 0 200 l -200 0 Z"); | 36 path.setAttribute("d", "M 0 0 l 200 0 l 0 200 l -200 0 Z"); |
37 | 37 |
38 clipPath.appendChild(path); | 38 clipPath.appendChild(path); |
39 content.appendChild(clipPath); | 39 content.appendChild(clipPath); |
40 | 40 |
41 if (window.testRunner) | 41 finishRepaintTest(); |
42 testRunner.notifyDone(); | |
43 } | 42 } |
44 </script> | 43 </script> |
45 | 44 |
46 </svg> | 45 </svg> |
OLD | NEW |