Chromium Code Reviews| Index: ManualTests/draw-system-focus-ring-dirty-rect.html |
| diff --git a/ManualTests/draw-system-focus-ring-dirty-rect.html b/ManualTests/draw-system-focus-ring-dirty-rect.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c21bf0e7ac59eb6c6cde0d590317e746cdb794e4 |
| --- /dev/null |
| +++ b/ManualTests/draw-system-focus-ring-dirty-rect.html |
| @@ -0,0 +1,57 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| + <title>drawSystemFocusRing() dirty rect test</title> |
| + <script src="../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| + <p>This test is passed if result1 is exactly the same with result2.</p> |
| + <p> |
| + <button id="result1">Result1</button> |
| + <button id="result2">Result2</button> |
| + </p> |
| + <canvas id="canvas" class="output" width="300" height="300"> |
| + <button id="button"></button> |
| + </canvas> |
| +<script> |
| + |
| + var canvas = document.getElementById("canvas"); |
| + var context = canvas.getContext("2d"); |
| + var button = document.getElementById("button"); |
| + var result1 = document.getElementById("result1"); |
| + var result2 = document.getElementById("result2"); |
| + |
| + function drawResult(delayed) { |
| + |
| + context.beginPath(); |
| + context.rect(0, 0, 300, 300); |
| + context.fillStyle = "black"; |
| + context.fill(); |
| + |
| + context.beginPath(); |
| + context.rect(50, 50, 200, 100); |
| + context.fillStyle = "blue"; |
| + context.fill(); |
| + |
| + button.focus(); |
| + |
| + if (delayed) { |
| + setTimeout(function() { |
| + context.drawSystemFocusRing(button); |
| + }, 500); |
|
Justin Novosad
2014/03/20 19:27:38
Does the timeout need to be this long? If you wan
|
| + } else { |
| + context.drawSystemFocusRing(button); |
| + } |
| + } |
| + |
| + result1.addEventListener("click", function() { |
| + drawResult(false); |
| + }, false); |
| + |
| + result2.addEventListener("click", function() { |
| + drawResult(true); |
| + }, false); |
| + |
| +</script> |
| +</body> |
| +</html> |