7496a7de80938850d10dea39e77af75b5a4d3dfe
[WebKit-https.git] / LayoutTests / accessibility / mac / css-speech-speak.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 <style>
6 div.speech-none { speak: none; }
7 div.speech-normal { speak: normal; }
8 div.speech-spellout { speak: spell-out; }
9 div.speech-digits { speak: digits; }
10 div.speech-literalpunc { speak: literal-punctuation; }
11 div.speech-nopunc { speak: no-punctuation; }
12 </style>
13 </head>
14 <body id="body">
15
16
17 <div tabindex="0" id="initial" >Initial</div>
18 <div tabindex="0" id="speech-none" class="speech-none">No speech</div>
19 <div tabindex="0" id="speech-normal" class="speech-normal">Normal</div>
20 <div tabindex="0" id="speech-spellout" class="speech-spellout">Spellout</div>
21 <div tabindex="0" id="speech-digits" class="speech-digits">Digits</div>
22 <div tabindex="0" id="speech-literalpunc" class="speech-literalpunc">Literal</div>
23 <div tabindex="0" id="speech-nopunc" class="speech-nopunc">No punctuation</div>
24
25 <div style='speak: digits;'>
26  <div>
27   <div>
28     <a id="testlink" tabindex="0" href="#">test</a>
29   </div>
30  </div>
31 </div>
32
33 <p id="description"></p>
34 <div id="console"></div>
35
36 <script>
37
38     description("This tests that using the CSS3-speech property 'speak' works as from a WebCore level (not a platform level, that is up to the platforms)");
39
40     if (window.accessibilityController) {
41
42           document.getElementById("initial").focus();
43           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'normal'");
44
45           document.getElementById("speech-none").focus();
46           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'none'");
47
48           document.getElementById("speech-normal").focus();
49           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'normal'");
50
51           document.getElementById("speech-spellout").focus();
52           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'spell-out'");
53
54           document.getElementById("speech-digits").focus();
55           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'digits'");
56
57           document.getElementById("speech-literalpunc").focus();
58           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'literal-punctuation'");
59
60           document.getElementById("speech-nopunc").focus();
61           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'no-punctuation'");
62
63           document.getElementById("testlink").focus();
64           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speak", "'digits'");
65     }
66
67 </script>
68
69 <script src="../../resources/js-test-post.js"></script>
70 </body>
71 </html>