blob: dbd0ada9ce5c78464c1bd968fdd0346e939336d1 [file] [log] [blame]
<html>
<script>
if (window.testRunner)
testRunner.dumpAsText();
// The Mac port exposes static text objects as an accessible child of an element with text.
// The ATSPI based ports fold static text objects into the parent element.
function getTextChild(accessibilityObject) {
if (accessibilityObject.childrenCount)
return accessibilityObject.childAtIndex(0);
return accessibilityObject;
}
</script>
<head>
<meta http-equiv="content-language" content="en-gb">
<body id="body">
<!-- This tests the ability to get the content language for various elements using various techniques -->
cheerio
<p lang="de">germannish</p>
<p lang="ja">elvish</p>
and more english
<div id="result"></div>
<script>
if (window.accessibilityController) {
var body = document.getElementById("body");
body.focus();
var webArea = accessibilityController.focusedElement;
var result = document.getElementById("result");
var text1 = getTextChild(webArea.childAtIndex(0));
var text2 = getTextChild(webArea.childAtIndex(1));
var text3 = getTextChild(webArea.childAtIndex(2));
var text4 = getTextChild(webArea.childAtIndex(3));
if ( webArea.language == "AXLanguage: en-gb" && text1.language == "AXLanguage: en-gb" &&
text2.language == "AXLanguage: de" && text3.language == "AXLanguage: ja" &&
text4.language == "AXLanguage: en-gb") {
result.innerText = "Passed";
}
else {
result.innerText = "Failed. Could not find AXLanguages: " + webArea.language + " - " + text1.language;
}
}
</script>
</body>
</html>