3 <title>Canvas test: drawSystemFocusRing
</title>
4 <script src=
"../resources/js-test.js"></script>
6 <body style=
"padding: 0; margin: 0">
7 <canvas id=
"canvas" class=
"output" width=
"300" height=
"350">
8 <button id=
"button1"></button>
10 <button id=
"button2"></button>
14 if (window
.testRunner
)
15 testRunner
.dumpAsText();
17 if (window
.accessibilityController
) {
18 window
.axButton1
= window
.accessibilityController
.accessibleElementById("button1");
19 window
.axContainer
= window
.accessibilityController
.accessibleElementById("container");
20 window
.axButton2
= window
.accessibilityController
.accessibleElementById("button2");
23 var canvas
= document
.getElementById("canvas").getContext("2d");
25 canvas
.translate(50, 50);
28 canvas
.rect(0, 0, 200, 100);
29 canvas
.fillStyle
= '#ccf';
31 canvas
.drawFocusIfNeeded(document
.getElementById('button1'));
34 canvas
.rect(0, 150, 200, 100);
35 canvas
.fillStyle
= '#cfc';
37 canvas
.drawFocusIfNeeded(document
.getElementById('button2'));
41 shouldBe("axButton1.x", "50");
42 shouldBe("axButton1.y", "50");
43 shouldBe("axButton1.width", "200");
44 shouldBe("axButton1.height", "100");
46 shouldBe("axContainer.x", "50");
47 shouldBe("axContainer.y", "200");
48 shouldBe("axContainer.width", "200");
49 shouldBe("axContainer.height", "100");
51 shouldBe("axButton2.x", "50");
52 shouldBe("axButton2.y", "200");
53 shouldBe("axButton2.width", "200");
54 shouldBe("axButton2.height", "100");