AX: Implement updated CSS3 Speech for 'speak' and 'speak-as' properties
[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-normal { speak-as: normal; }
7 div.speech-spellout { speak-as: spell-out; }
8 div.speech-digits { speak-as: digits; }
9 div.speech-literalpunc { speak-as: literal-punctuation; }
10 div.speech-nopunc { speak-as: no-punctuation; }
11 div.digits-and-literal { speak-as: digits literal-punctuation; }
12 div.spell-and-literal { speak-as: spell-out literal-punctuation; }
13 </style>
14 </head>
15 <body id="body">
16
17
18 <div tabindex="0" id="initial" >Initial</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 <div tabindex="0" id="speech-digits-and-literal" class="digits-and-literal">Digits and Literal</div>
25 <div tabindex="0" id="speech-spell-and-literal" class="spell-and-literal">Spell and Literal</div>
26
27 <div style='speak-as: digits;'>
28  <div>
29   <div>
30     <a id="testlink" tabindex="0" href="#">test</a>
31   </div>
32  </div>
33 </div>
34
35 <p id="description"></p>
36 <div id="console"></div>
37
38 <script>
39
40     description("This tests that using the CSS3-speech property 'speak-as' works as from a WebCore level (not a platform level, that is up to the platforms)");
41
42     if (window.accessibilityController) {
43
44           document.getElementById("initial").focus();
45           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal'");
46
47           document.getElementById("speech-normal").focus();
48           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal'");
49
50           document.getElementById("speech-spellout").focus();
51           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'spell-out'");
52
53           document.getElementById("speech-digits").focus();
54           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, digits'");
55
56           document.getElementById("speech-literalpunc").focus();
57           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, literal-punctuation'");
58
59           document.getElementById("speech-nopunc").focus();
60           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, no-punctuation'");
61
62           document.getElementById("speech-digits-and-literal").focus();
63           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, digits, literal-punctuation'");
64
65           document.getElementById("speech-spell-and-literal").focus();
66           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'spell-out, literal-punctuation'");
67
68           document.getElementById("testlink").focus();
69           shouldBe("accessibilityController.focusedElement.childAtIndex(0).speakAs", "'normal, digits'");
70     }
71
72 </script>
73
74 <script src="../../resources/js-test-post.js"></script>
75 </body>
76 </html>