OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body id="body"> | 6 <body id="body"> |
7 | 7 |
8 <div role="group" tabindex="0" id="images"> | 8 <div role="group" tabindex="0" id="images"> |
9 <img alt="" height="100" width="100"> | 9 <img alt="" height="100" width="100"> |
10 <img title="test1" height="100" width="100"> | 10 <img title="test1" height="100" width="100"> |
11 <img alt="alt" title="test2" height="100" width="100"> | 11 <img alt="alt" title="test2" height="100" width="100"> |
12 <div role="img" title="test3" width="100" height="100">test</div> | 12 <div role="img" title="test3" width="100" height="100">test</div> |
13 <div role="img" alt="alt" title="test4" width="100" height="100">test</div> | 13 <div role="img" alt="alt" title="test4" width="100" height="100">test</div> |
14 </div> | 14 </div> |
15 | 15 |
16 <p id="description"></p> | 16 <p id="description"></p> |
17 <div id="console"></div> | 17 <div id="console"></div> |
18 | 18 |
19 <script> | 19 <script> |
20 | 20 |
21 description("This tests that images will fallback to using the title attribu
te if no other descriptive text is present."); | 21 description("This tests that images will fallback to using the title attribu
te if no other descriptive text is present."); |
22 | 22 |
23 if (window.accessibilityController) { | 23 if (window.accessibilityController) { |
24 | 24 |
25 document.getElementById("images").focus(); | 25 document.getElementById("images").focus(); |
26 var imagesGroup = accessibilityController.focusedElement; | 26 var imagesGroup = accessibilityController.focusedElement; |
27 | 27 |
28 // First image should have a description of "test1" because there is no
alt tag (it should use the title). | 28 // First image should have a description of "test1" because there is no
alt tag (it should use the title). |
29 // The title should NOT be in the help text. | 29 // The title should NOT be in the description. |
30 var image1 = imagesGroup.childAtIndex(0).childAtIndex(0); | 30 var image1 = imagesGroup.childAtIndex(0).childAtIndex(0); |
31 debug("Image1 description: " + image1.deprecatedDescription); | 31 debug("Image1 name: " + image1.name); |
32 debug("Image1 help: " + image1.deprecatedHelpText + "<br>"); | 32 debug("Image1 description: " + image1.description + "<br>"); |
33 | 33 |
34 // Second image should use the description from the alt tag instead of t
he title. | 34 // Second image should use the alt tag instead of the title. |
35 // The help text should reflect what's in the title. | 35 // The description should reflect what's in the title. |
36 var image2 = imagesGroup.childAtIndex(0).childAtIndex(1); | 36 var image2 = imagesGroup.childAtIndex(0).childAtIndex(1); |
37 debug("Image2 description: " + image2.deprecatedDescription); | 37 debug("Image2 name: " + image2.name); |
38 debug("Image2 help: " + image2.deprecatedHelpText + "<br>"); | 38 debug("Image2 description: " + image2.description + "<br>"); |
39 | 39 |
40 // Now do the same checks for ARIA type images. | 40 // Now do the same checks for ARIA type images. |
41 var image3 = imagesGroup.childAtIndex(1); | 41 var image3 = imagesGroup.childAtIndex(1); |
42 debug("Image3 description: " + image3.deprecatedDescription); | 42 debug("Image3 name: " + image3.name); |
43 debug("Image3 help: " + image3.deprecatedHelpText + "<br>"); | 43 debug("Image3 description: " + image3.description + "<br>"); |
44 | 44 |
45 // Now do the same checks for ARIA type images. | 45 // Now do the same checks for ARIA type images. |
46 var image4 = imagesGroup.childAtIndex(2); | 46 var image4 = imagesGroup.childAtIndex(2); |
47 debug("Image4 description: " + image4.deprecatedDescription); | 47 debug("Image4 name: " + image4.name); |
48 debug("Image4 help: " + image4.deprecatedHelpText + "<br>"); | 48 debug("Image4 description: " + image4.description + "<br>"); |
49 | 49 |
50 // Verify that the first image (with an empty alt tag) is ignored | 50 // Verify that the first image (with an empty alt tag) is ignored |
51 // by checking the children count of the group containing the native ima
ges == 2. | 51 // by checking the children count of the group containing the native ima
ges == 2. |
52 shouldBe("imagesGroup.childAtIndex(0).childrenCount", "2"); | 52 shouldBe("imagesGroup.childAtIndex(0).childrenCount", "2"); |
53 } | 53 } |
54 | 54 |
55 </script> | 55 </script> |
56 | 56 |
57 </body> | 57 </body> |
58 </html> | 58 </html> |
OLD | NEW |