Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: ManualTests/draw-system-focus-ring-dirty-rect.html

Issue 200283003: drawFocusRing() function in CRC2D draws invalid focus ring. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: manual test Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/html/canvas/CanvasRenderingContext2D.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | Source/core/html/canvas/CanvasRenderingContext2D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698