1 <!DOCTYPE html PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../resources/js-test-pre.js"></script>
5 <script src=
"../resources/accessibility-helper.js"></script>
8 <div tabindex=
"0" role=
"group" id=
"images">
9 <img alt=
"cake0" src=
"resources/cake.png" /><br />
10 <img alt
class=
"cake1 unassigned-alt" src=
"resources/cake.png" /><br />
11 <img alt=
"cake2" src=
"resources/cake.png" /><br />
14 <p id=
"description"></p>
15 <div id=
"console"></div>
19 'This tests that img elements with an alt attribute and no assigned value are ignored.',
21 if (window
.accessibilityController
) {
22 document
.getElementById('images').focus();
23 var imagesGroup
= accessibilityController
.focusedElement
;
24 // there are 3 images, but one has an alt attribute that is unassigned, so it should be
25 // ignored. as a result, the image count is 2.
26 shouldBe('imagesGroup.childrenCount', '2');
27 // make sure alt text is being read before and after
28 shouldBeEqualToString(
29 'platformValueForW3CName(imagesGroup.childAtIndex(0))',
32 // accessiblityController should see the <img> element w/o alt attribute as an image,
33 // and use the filename as the alt text. currently it returns an empty string.
34 // this issue is documented here: <rdar://problem/51669261>
35 // shouldBeEqualToString("platformValueForW3CName(imagesGroup.childAtIndex(1))", "cake.png");
36 shouldBeEqualToString(
37 'platformValueForW3CName(imagesGroup.childAtIndex(1))',
43 <script src=
"../resources/js-test-post.js"></script>