REGRESSION(r184899): Crash when focusing an input element styled with a web font
[WebKit-https.git] / LayoutTests / platform / mac / accessibility / aria-liveregion-on-image.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test-pre.js"></script>
5 </head>
6 <body id="body">
7
8 <img aria-live="polite" src="test.gif" width=100 height=100 alt="alt text" tabindex=0 id="image">
9
10 <p id="description"></p>
11 <div id="console"></div>
12
13 <script>
14
15     description("This tests that ARIA live regions that is on an image will work when the alt tag is changed.");
16
17     var image = 0;
18     function ariaCallback(notification) {
19         if (notification == "AXLiveRegionChanged") {
20             image.removeNotificationListener();
21             window.testRunner.notifyDone();
22         }
23     }
24
25     if (window.accessibilityController) {
26         window.testRunner.waitUntilDone();
27
28         document.getElementById("image").focus();
29         image = window.accessibilityController.focusedElement;
30
31         var addedNotification = image.addNotificationListener(ariaCallback);
32         shouldBe("addedNotification", "true");
33
34         // this should also trigger our live region change because its a text alternative change. 
35         document.getElementById("image").setAttribute('alt', "new image text");
36     }
37
38 </script>
39
40 <script src="../../../resources/js-test-post.js"></script>
41 </body>
42 </html>