blob: 56fd3613a8bde0519b8500c0b244b688b18012db [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 Atk port folds 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>