haikuwebkit/LayoutTests/accessibility/image-with-alt-and-map.html

41 lines
1.4 KiB
HTML
Raw Permalink Normal View History

AX: [ATK] Accessible names missing for imagemap images and links https://bugs.webkit.org/show_bug.cgi?id=127288 Source/WebCore: Reviewed by Chris Fleizach. Return the alt text, if present, for the accessible name for image maps and image map links for ATK. Also expose the accessible element with ATK_ROLE_IMAGE_MAP instead of ATK_ROLE_IMAGE. Test: accessibility/image-with-alt-and-map.html * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isImageMap): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetName): (atkRole): LayoutTests: New and updated tests to reflect the expected role, accessible hierarchy, and exposure of the alternative text for each platform. Reviewed by Chris Fleizach. * accessibility/image-with-alt-and-map.html: Added. * accessibility/roles-exposed.html: Added some more elements to the test. * platform/efl/accessibility/image-map1-expected.txt: Added. * platform/efl/accessibility/image-map2-expected.txt: Updated to reflect fix. * platform/efl/accessibility/image-with-alt-and-map-expected.txt: Added. * platform/efl/accessibility/roles-exposed-expected.txt: Updated for added elements. * platform/gtk/accessibility/image-map1-expected.txt: Added. * platform/gtk/accessibility/image-map2-expected.txt: Updated to reflect fix. * platform/gtk/accessibility/image-with-alt-and-map-expected.txt: Added. * platform/gtk/accessibility/roles-exposed-expected.txt: Updated for added elements. * platform/mac/accessibility/image-with-alt-and-map-expected.txt: Added. * platform/mac/accessibility/roles-exposed-expected.txt: Updated for added elements. * platform/mac-mavericks/accessibility/roles-exposed-expected.txt: Updated for added elements. * platform/mac-mountainlion/accessibility/roles-exposed-expected.txt: Updated for added elements. Canonical link: https://commits.webkit.org/156885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-11-22 18:18:11 +00:00
<html>
<head>
<script>
function dumpAccessibilityChildren(element, level) {
if (element.stringValue.indexOf('End of test') >= 0)
return false;
var indent = "";
for (var k = 0; k < level; k++) { indent += " "; }
debug(indent + element.role + " " + element.title + " " + element.description);
var childrenCount = element.childrenCount;
for (var k = 0; k < childrenCount; k++) {
if (!dumpAccessibilityChildren(element.childAtIndex(k), level+1))
return false;
}
return true;
}
</script>
<script src="../resources/js-test-pre.js"></script>
</head>
<body id="body">
<img src="myimg.png" width="100" height="100" usemap="#mymap" alt="foo bar baz" />
<map name="mymap">
<area shape="rect" coords="0, 0, 33, 100" alt="foo" href="#">
<area shape="rect" coords="33, 0, 66, 100" alt="bar" href="#">
<area shape="rect" coords="66, 0, 100, 100" alt="baz" href="#">
</map>
<div>End of test</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests the hierarchy of an image with alt text and a map.");
if (window.accessibilityController) {
document.getElementById("body").focus();
dumpAccessibilityChildren(accessibilityController.focusedElement, 0);
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>