| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
| <html> | |
| <head> | |
| <script src="../resources/js-test.js"></script> | |
| <style> | |
| div.speech-normal { speak-as: normal; } | |
| div.speech-spellout { speak-as: spell-out; } | |
| div.speech-digits { speak-as: digits; } | |
| div.speech-literalpunc { speak-as: literal-punctuation; } | |
| div.speech-nopunc { speak-as: no-punctuation; } | |
| div.digits-and-literal { speak-as: digits literal-punctuation; } | |
| div.spell-and-literal { speak-as: spell-out literal-punctuation; } | |
| </style> | |
| </head> | |
| <body id="body"> | |
| <div tabindex="0" id="initial" >Initial</div> | |
| <div tabindex="0" id="speech-normal" class="speech-normal">Normal</div> | |
| <div tabindex="0" id="speech-spellout" class="speech-spellout">Spellout</div> | |
| <div tabindex="0" id="speech-spellout-display-contents" class="speech-spellout" style="display:contents">Spellout (display:contents)</div> | |
| <div tabindex="0" id="speech-digits" class="speech-digits">Digits</div> | |
| <div tabindex="0" id="speech-literalpunc" class="speech-literalpunc">Literal</div> | |
| <div tabindex="0" id="speech-nopunc" class="speech-nopunc">No punctuation</div> | |
| <div tabindex="0" id="speech-digits-and-literal" class="digits-and-literal">Digits and Literal</div> | |
| <div tabindex="0" id="speech-spell-and-literal" class="spell-and-literal">Spell and Literal</div> | |
| <div style='speak-as: digits;'> | |
| <div> | |
| <div> | |
| <a id="testlink" tabindex="0" href="#">test</a> | |
| </div> | |
| </div> | |
| </div> | |
| <p id="description"></p> | |
| <div id="console"></div> | |
| <script> | |
| 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)"); | |
| var element; | |
| function expectValueForId(id, expectedValue) { | |
| debug(`Testing #${id}`) | |
| element = accessibilityController.accessibleElementById(id); | |
| shouldBe("element.childAtIndex(0).speakAs", `"${expectedValue}"`); | |
| } | |
| if (window.accessibilityController) { | |
| expectValueForId("initial", "normal"); | |
| expectValueForId("speech-normal", "normal"); | |
| expectValueForId("speech-spellout", "spell-out"); | |
| expectValueForId("speech-spellout-display-contents", "spell-out"); | |
| expectValueForId("speech-digits", "normal, digits"); | |
| expectValueForId("speech-literalpunc", "normal, literal-punctuation"); | |
| expectValueForId("speech-nopunc", "normal, no-punctuation"); | |
| expectValueForId("speech-digits-and-literal", "normal, digits, literal-punctuation"); | |
| expectValueForId("speech-spell-and-literal", "spell-out, literal-punctuation"); | |
| expectValueForId("testlink", "normal, digits"); | |
| } | |
| </script> | |
| </body> | |
| </html> |