OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>drawSystemFocusRing() dirty rect test</title> |
| 5 <script src="../../resources/js-test.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <canvas id="canvas" class="output" width="300" height="300"> |
| 9 <button id="button"></button> |
| 10 </canvas> |
| 11 <script> |
| 12 if (window.testRunner) { |
| 13 testRunner.dumpAsTextWithPixelResults(); |
| 14 testRunner.waitUntilDone(); |
| 15 } |
| 16 |
| 17 var canvas = document.getElementById("canvas"); |
| 18 var context = canvas.getContext("2d"); |
| 19 |
| 20 context.beginPath(); |
| 21 context.rect(0, 0, 300, 300); |
| 22 context.fillStyle = "black"; |
| 23 context.fill(); |
| 24 |
| 25 context.beginPath(); |
| 26 context.rect(50, 50, 200, 100); |
| 27 context.fillStyle = "blue"; |
| 28 context.fill(); |
| 29 |
| 30 var button = document.getElementById("button"); |
| 31 |
| 32 button.addEventListener("focus", function() { |
| 33 context.drawSystemFocusRing(button); |
| 34 }); |
| 35 |
| 36 // avoid painting of creating canvas |
| 37 setTimeout(function() { |
| 38 button.focus(); |
| 39 |
| 40 if (window.testRunner) |
| 41 testRunner.notifyDone(); |
| 42 }, 500); |
| 43 |
| 44 </script> |
| 45 </body> |
| 46 </html> |
OLD | NEW |