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

Unified Diff: LayoutTests/fast/canvas/canvas-hit-regions-accessibility-test.html

Issue 300223009: Implement basic parts of hit regions on canvas2d. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 7 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/canvas-hit-regions-accessibility-test.html
diff --git a/LayoutTests/fast/canvas/canvas-hit-regions-accessibility-test.html b/LayoutTests/fast/canvas/canvas-hit-regions-accessibility-test.html
new file mode 100644
index 0000000000000000000000000000000000000000..6034fad93ee7b16c45d85b36a63bf39859a33e1e
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-hit-regions-accessibility-test.html
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML>
+<head>
+<title>Canvas Hit Regions: accessibility test</title>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body style="padding : 0; margin : 0;">
fs 2014/06/03 11:47:01 Probably would be good to have these be != 0 - eit
+<canvas id="canvas" class="output" width="300" height="350">
+ <button id="button1"></button>
+ <div id="container">
+ <button id="button2"></button>
+ </div>
+</canvas>
+<script>
+
+ if (window.accessibilityController) {
+ window.axButton1 = window.accessibilityController.accessibleElementById("button1");
dmazzoni 2014/06/03 17:26:10 You don't need "window." anywhere in this test - l
fs 2014/06/04 08:13:40 "local" variables in this scope will be on the glo
+ window.axContainer = window.accessibilityController.accessibleElementById("container");
+ window.axButton2 = window.accessibilityController.accessibleElementById("button2");
+ }
+
+ var canvas = document.getElementById("canvas");
+ var context = canvas.getContext("2d");
+
+ context.save();
+ context.translate(50, 50);
+
+ context.beginPath();
+ context.rect(0, 0, 200, 100);
+ context.fillStyle = '#ccf';
+ context.fill();
+ context.addHitRegion({ id : "button1", control : document.getElementById('button1') });
+
+ context.beginPath();
+ context.rect(0, 150, 200, 100);
+ context.fillStyle = '#cfc';
+ context.fill();
+ context.addHitRegion({ id : "button2", control : document.getElementById('button2') });
+
+ context.restore();
+
+ shouldBe("axButton1.x", "50");
+ shouldBe("axButton1.y", "50");
+ shouldBe("axButton1.width", "200");
+ shouldBe("axButton1.height", "100");
+
+ shouldBe("axContainer.x", "50");
+ shouldBe("axContainer.y", "200");
+ shouldBe("axContainer.width", "200");
+ shouldBe("axContainer.height", "100");
+
+ shouldBe("axButton2.x", "50");
+ shouldBe("axButton2.y", "200");
+ shouldBe("axButton2.width", "200");
+ shouldBe("axButton2.height", "100");
+
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698