| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 | |
| 5 <div id="wrapper1"> | |
| 6 <a href="#"><img id="img1" alt="Delicious cake" src="resources/cake.png"></a
> | |
| 7 </div> | |
| 8 | |
| 9 <script> | |
| 10 async_test(function(t) | |
| 11 { | |
| 12 var axImg = accessibilityController.accessibleElementById("img1"); | |
| 13 axImg.addNotificationListener(function(notification) { | |
| 14 if (notification == 'Clicked') { | |
| 15 document.getElementById("wrapper1").style.display = "none"; | |
| 16 t.done(); | |
| 17 } | |
| 18 }); | |
| 19 | |
| 20 var img = document.getElementById("img1"); | |
| 21 img.addEventListener("click", function(e) | |
| 22 { | |
| 23 img.title = "clicked"; | |
| 24 }); | |
| 25 img.click(); | |
| 26 }, "clicking an image via javascript sends an accessible click event"); | |
| 27 </script> | |
| 28 | |
| 29 <div id="wrapper2"> | |
| 30 <a href="#"><img id="img2" alt="Delicious cake" src="resources/cake.png"></a
> | |
| 31 </div> | |
| 32 | |
| 33 <script> | |
| 34 async_test(function(t) | |
| 35 { | |
| 36 var axImg = accessibilityController.accessibleElementById("img2"); | |
| 37 axImg.addNotificationListener(function(notification) { | |
| 38 if (notification == 'Clicked') { | |
| 39 document.getElementById("wrapper2").style.display = "none"; | |
| 40 t.done(); | |
| 41 } | |
| 42 }); | |
| 43 | |
| 44 var img = document.getElementById("img2"); | |
| 45 img.addEventListener("click", function(e) | |
| 46 { | |
| 47 img.title = "clicked"; | |
| 48 }); | |
| 49 eventSender.mouseMoveTo(axImg.x + 10, axImg.y + 10); | |
| 50 eventSender.mouseDown(); | |
| 51 eventSender.mouseUp(); | |
| 52 }, "clicking an image via mouse events sends an accessible click event"); | |
| 53 </script> | |
| 54 | |
| 55 <div id="wrapper4"> | |
| 56 <a href="#"><img id="img4" alt="Delicious cake" src="resources/cake.png"></a
> | |
| 57 </div> | |
| 58 | |
| 59 <script> | |
| 60 async_test(function(t) | |
| 61 { | |
| 62 var axEvent = false; | |
| 63 var domEvent = false; | |
| 64 var axImg = accessibilityController.accessibleElementById("img4"); | |
| 65 axImg.addNotificationListener(function(notification) { | |
| 66 if (notification == 'Clicked') { | |
| 67 axEvent = true; | |
| 68 } | |
| 69 }); | |
| 70 | |
| 71 var img = document.getElementById("img4"); | |
| 72 img.addEventListener("click", function(e) | |
| 73 { | |
| 74 img.title = "clicked"; | |
| 75 domEvent = true; | |
| 76 }); | |
| 77 axImg.press(); | |
| 78 | |
| 79 setTimeout(function() | |
| 80 { | |
| 81 if (axEvent && domEvent) { | |
| 82 document.getElementById("wrapper4").style.display = "none"; | |
| 83 t.done(); | |
| 84 } | |
| 85 }); | |
| 86 }, "clicking an image via accessibility sends both an accessible and a DOM click
event"); | |
| 87 </script> | |
| OLD | NEW |