| 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"> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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 help text. |
| 30 var image1 = imagesGroup.childAtIndex(0).childAtIndex(0); | 30 var image1 = imagesGroup.childAtIndex(0).childAtIndex(0); |
| 31 debug("Image1 description: " + image1.description); | 31 debug("Image1 description: " + image1.deprecatedDescription); |
| 32 debug("Image1 help: " + image1.helpText + "<br>"); | 32 debug("Image1 help: " + image1.deprecatedHelpText + "<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 description from the alt tag instead of t
he title. |
| 35 // The help text should reflect what's in the title. | 35 // The help text 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.description); | 37 debug("Image2 description: " + image2.deprecatedDescription); |
| 38 debug("Image2 help: " + image2.helpText + "<br>"); | 38 debug("Image2 help: " + image2.deprecatedHelpText + "<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.description); | 42 debug("Image3 description: " + image3.deprecatedDescription); |
| 43 debug("Image3 help: " + image3.helpText + "<br>"); | 43 debug("Image3 help: " + image3.deprecatedHelpText + "<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.description); | 47 debug("Image4 description: " + image4.deprecatedDescription); |
| 48 debug("Image4 help: " + image4.helpText + "<br>"); | 48 debug("Image4 help: " + image4.deprecatedHelpText + "<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 |