Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <head> | |
| 3 <script src="resources/SVGTestCase.js"></script> | |
| 4 <script src="../../fast/repaint/resources/text-based-repaint.js"></script> | |
|
fs
2015/04/30 13:24:43
This test looks really complicated, and why is it
Shanmuga Pandi
2015/04/30 13:42:57
Ok. I will check for reducing the complexity.
Shanmuga Pandi
2015/05/04 13:06:28
Changed logic !!
| |
| 5 <script> | |
| 6 window.testIsAsync = true; | |
| 7 | |
| 8 function finishTest() { | |
| 9 finishRepaintTest(); | |
| 10 } | |
| 11 | |
| 12 function click(x,y) { | |
| 13 if (window.eventSender) { | |
| 14 eventSender.mouseMoveTo(x, y); | |
| 15 eventSender.mouseDown(); | |
| 16 eventSender.mouseUp(); | |
| 17 } | |
| 18 } | |
| 19 | |
| 20 function repaintTest() | |
| 21 { | |
| 22 var rect = document.getElementById('rect'); | |
| 23 var anim = document.getElementById('anim'); | |
| 24 var actions = [ | |
| 25 function() { | |
| 26 click(50,50); | |
| 27 }, | |
| 28 function() { | |
| 29 rect.setAttribute("fill", "green"); | |
| 30 anim.setAttribute("from", "green"); | |
| 31 anim.setAttribute("to", "red"); | |
| 32 anim.setAttribute("fill", "freeze"); | |
| 33 }, | |
| 34 function() { | |
| 35 click(50,50); | |
| 36 }, | |
| 37 function() { | |
| 38 finishTest(); | |
| 39 }, | |
| 40 ]; | |
| 41 | |
| 42 function nextAction() { | |
| 43 var f = actions.shift(); | |
| 44 if (!f) | |
| 45 return; | |
| 46 f(); | |
| 47 setTimeout(nextAction,50); | |
| 48 } | |
| 49 nextAction(); | |
| 50 } | |
| 51 </script> | |
| 52 </head> | |
| 53 <body onload="runRepaintAndPixelTest()"> | |
| 54 <svg height="200" width="200"> | |
| 55 <rect id="rect" width="100px" height="100px" fill="red"/> | |
| 56 <animate id="anim" xlink:href="#rect" | |
| 57 begin="rect.click" | |
| 58 dur="0.01s" | |
| 59 attributeType="xml" | |
| 60 attributeName="fill" | |
| 61 from="green" to="red" | |
| 62 repeatCount="1" | |
| 63 restart="never"/> | |
| 64 </svg> | |
| 65 </body> | |
| 66 </html> | |
| OLD | NEW |