Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / accessibility / img-aria-button-alt-tag.html
blobc90e013a9c5c18f0dc5a901c9d3925283d353c44
1 <html>
2 <script>
3 if (window.layoutTestController)
4 layoutTestController.dumpAsText();
5 </script>
6 <body id="body">
8 <!-- This test makes sure that a img acting as an aria button still returns its alt tag as the description -->
10 <img id='image' src="resources/cake.png" role="button" alt="alternate" title="title">
12 <div id="result"></div>
15 <script>
16 if (window.accessibilityController) {
17 var result = document.getElementById("result");
19 var body = document.getElementById("body");
20 body.focus();
21 var imgUIElement = accessibilityController.focusedElement.childAtIndex(0).childAtIndex(0);
22 var pattern = "AXDescription: alternate";
23 if (imgUIElement.allAttributes().indexOf(pattern) != -1) {
24 result.innerText += "Test passed\n";
26 else {
27 result.innerText += "Test failed\n";
30 </script>
31 </body>
32 </html>