2 <script type=
"text/javascript">
4 function drawCanvas(context
) {
5 context
.lineWidth
= 10.0;
6 context
.lineCap
= "round";
10 // Draw a bounds rect (default color is black)
11 context
.strokeRect(0, 0, 300, 300);
13 context
.strokeStyle
= "#808080";
15 // Draw a vertical line
16 context
.moveTo(150, 100);
17 context
.lineTo(150, 200);
20 // Draw a horizontal line
21 context
.moveTo(100, 150);
22 context
.lineTo(200, 150);
27 var context
= document
.getElementById("myCanvas").getContext("2d");
32 if (window
.layoutTestController
)
33 layoutTestController
.dumpAsText();
35 <body id=
"body" onload=
"_onload()">
39 <!-- This test makes sure that a canvas element shows up as an image -->
41 <canvas id=
"myCanvas" style=
"width:300px;height:300px;" width='
300' height='
300'
alt=
"canvas 1"></canvas>
43 <div id=
"result"></div>
46 if (window
.accessibilityController
) {
47 var result
= document
.getElementById("result");
49 var body
= document
.getElementById("body");
51 var canvasElement
= accessibilityController
.focusedElement
.childAtIndex(0).childAtIndex(0);
53 var pattern
= "AXRole: AXImage";
54 if (canvasElement
.allAttributes().indexOf(pattern
) != -1) {
55 result
.innerText
+= "Test passed\n";
58 result
.innerText
+= "Test failed\n" + canvasElement
.allAttributes();