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

Unified Diff: LayoutTests/fast/canvas/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: layout 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
Index: LayoutTests/fast/canvas/draw-system-focus-ring-dirty-rect.html
diff --git a/LayoutTests/fast/canvas/draw-system-focus-ring-dirty-rect.html b/LayoutTests/fast/canvas/draw-system-focus-ring-dirty-rect.html
new file mode 100644
index 0000000000000000000000000000000000000000..588d861cc00c049b6a3c6c8952717cdfa46e7fb9
--- /dev/null
+++ b/LayoutTests/fast/canvas/draw-system-focus-ring-dirty-rect.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>drawSystemFocusRing() dirty rect test</title>
+ <script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<canvas id="canvas" class="output" width="300" height="300">
+ <button id="button"></button>
+</canvas>
+<script>
+ if (window.testRunner) {
+ testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+ }
+
+ var canvas = document.getElementById("canvas");
+ var context = canvas.getContext("2d");
+
+ 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();
+
+ var button = document.getElementById("button");
+
+ button.addEventListener("focus", function() {
+ context.drawSystemFocusRing(button);
+ });
+
+ // avoid painting of creating canvas
+ setTimeout(function() {
+ button.focus();
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 500);
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698