Update ReadMe.md
[qtwebkit.git] / LayoutTests / accessibility / img-alt-attribute-unassigned-value.html
blob14c2a30741124b68372823e205eb7da61689673c
1 <!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 <script src="../resources/accessibility-helper.js"></script>
6 </head>
7 <body id="body">
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 />
12 </div>
14 <p id="description"></p>
15 <div id="console"></div>
17 <script>
18 description(
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))',
30 'cake0',
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))',
38 'cake2',
41 </script>
43 <script src="../resources/js-test-post.js"></script>
44 </body>
45 </html>