blob: c319f0b2aa85e70f6bc8995db8eb825f0740ea12 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body id="body">
<img aria-live="polite" src="test.gif" width=100 height=100 alt="alt text" tabindex=0 id="image">
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that ARIA live regions that is on an image will work when the alt tag is changed.");
var image = 0;
function ariaCallback(notification) {
if (notification == "AXLiveRegionChanged") {
image.removeNotificationListener();
finishJSTest();
}
}
if (window.accessibilityController) {
jsTestIsAsync = true;
document.getElementById("image").focus();
image = window.accessibilityController.focusedElement;
var addedNotification = image.addNotificationListener(ariaCallback);
shouldBe("addedNotification", "true");
// this should also trigger our live region change because its a text alternative change.
document.getElementById("image").setAttribute('alt', "new image text");
}
</script>
</body>
</html>