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

Unified Diff: ManualTests/draw-focus-if-needed-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: rebase 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-focus-if-needed-dirty-rect.html
diff --git a/ManualTests/draw-focus-if-needed-dirty-rect.html b/ManualTests/draw-focus-if-needed-dirty-rect.html
new file mode 100644
index 0000000000000000000000000000000000000000..e5d8b6f4b348ec8a5044cb81fc288e0ef80cec53
--- /dev/null
+++ b/ManualTests/draw-focus-if-needed-dirty-rect.html
@@ -0,0 +1,55 @@
+<!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(separateFrame) {
+
+ button.focus();
+
+ requestAnimationFrame(function() {
+ context.beginPath();
+ context.rect(0, 0, 300, 300);
+ context.fill();
+
+ context.beginPath();
+ context.rect(50, 50, 200, 100);
+
+ if (separateFrame)
+ requestAnimationFrame(function() {
+ context.drawSystemFocusRing(button);
+ });
+ 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