| // 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; |
| <meta http-equiv="content-language" content="en-gb"> |
| <!-- This tests the ability to get the content language for various elements using various techniques --> |
| <p lang="de">germannish</p> |
| if (window.accessibilityController) { |
| var body = document.getElementById("body"); |
| 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"; |
| result.innerText = "Failed. Could not find AXLanguages: " + webArea.language + " - " + text1.language; |