haikuwebkit/LayoutTests/accessibility/image-role-is-synonomous-wi...

25 lines
927 B
HTML
Raw Permalink Normal View History

AX: Add ARIA role "image" as a new role, and leave "img" as a synonym https://bugs.webkit.org/show_bug.cgi?id=224615 Patch by Tyler Wilcock <twilco.o@protonmail.com> on 2021-07-12 Reviewed by Chris Fleizach. Source/WebCore: Test: accessibility/image-role-is-synonomous-with-img-role.html * accessibility/AccessibilityObject.cpp: (WebCore::initializeRoleMap): Add "image" ARIA role as a synonym for the "img" ARIA role, both of which map to the AccessibilityRole::Image WebCore representation. Also hardcode the ARIA reverse role map to return "image" for the AccessibilityRole::Image key. LayoutTests: The "image" role is replacing the "img" role (though "img" is not going away), so "image" should be returned from `computedRoleString`. * accessibility/image-role-is-synonomous-with-img-role-expected.txt: Added. * accessibility/image-role-is-synonomous-with-img-role.html: Added. * accessibility/roles-computedRoleString-expected.txt: * accessibility/roles-computedRoleString.html: * inspector/dom/getAccessibilityPropertiesForNode-expected.txt: * platform/glib/accessibility/roles-computedRoleString-expected.txt: * platform/gtk/accessibility/gtk/xml-roles-exposed-expected.txt: * platform/gtk/accessibility/image-link-expected.txt: * platform/gtk/inspector/dom/getAccessibilityPropertiesForNode-expected.txt: * platform/mac/accessibility/roles-computedRoleString-expected.txt: * platform/wpe/accessibility/image-link-expected.txt: All the tests in this group have been updated to expect "image" instead of "img". Canonical link: https://commits.webkit.org/239590@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-12 16:14:28 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script src="../resources/accessibility-helper.js"></script>
</head>
<body>
<div id="content">
<div id="img" role="img">This div should have a role of image.</div>
<div id="image" role="image">This div should also have a role of image.</div>
</div>
<script>
description("This test ensures that role=\"image\" and role=\"img\" are synonyms.");
if (window.accessibilityController) {
var img = accessibilityController.accessibleElementById("img");
var image = accessibilityController.accessibleElementById("image");
shouldBe("img.role", "'AXRole: AXImage'");
shouldBe("image.role", "'AXRole: AXImage'");
document.getElementById("content").style.visibility = "hidden";
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>