blob: a05781d4c7367766d8b2cae910211dbe0fb1a78b [file] [log] [blame]
cfleizach@apple.com1210e152012-09-12 22:56:47 +00001<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2<html>
3<head>
mark.lam@apple.coma931ab22013-09-08 01:18:24 +00004<script src="../resources/js-test-pre.js"></script>
jdiggs@igalia.com25615b92016-05-20 18:34:14 +00005<script src="../resources/accessibility-helper.js"></script>
cfleizach@apple.com1210e152012-09-12 22:56:47 +00006</head>
7<body id="body">
8
9<img id="realimage" tabindex="0" alt="TestImage" width="100" height="100">
10
11<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
12
13<image tabindex="0" id="svgimage" alt="TestImage" x="20" y="20" width="298" height="65" xlink:href="resources/cake.png"/>
14
15</svg>
16
17<p id="description"></p>
18<div id="console"></div>
19
20<script>
21
22 description("This tests that SVG images are accessible elements and they have the same attributes as real images.");
23
24 if (window.accessibilityController) {
25 document.getElementById("realimage").focus();
26 var realImage = accessibilityController.focusedElement;
27
28 document.getElementById("svgimage").focus();
29 var svgImage = accessibilityController.focusedElement;
30 shouldBe("svgImage.role", "realImage.role");
jdiggs@igalia.com25615b92016-05-20 18:34:14 +000031 shouldBe("platformValueForW3CName(svgImage)", "platformValueForW3CName(realImage)");
32 shouldBe("platformValueForW3CDescription(svgImage)", "platformValueForW3CDescription(realImage)");
33
cfleizach@apple.com1210e152012-09-12 22:56:47 +000034 debug("SVG Image Role: " + svgImage.role);
jdiggs@igalia.com25615b92016-05-20 18:34:14 +000035 debug("SVG Image Accessible Name: " + platformValueForW3CName(svgImage));
36 debug("SVG Image Accessible Description: " + platformValueForW3CDescription(svgImage));
cfleizach@apple.com1210e152012-09-12 22:56:47 +000037 }
38
39</script>
40
mark.lam@apple.coma931ab22013-09-08 01:18:24 +000041<script src="../resources/js-test-post.js"></script>
cfleizach@apple.com1210e152012-09-12 22:56:47 +000042</body>
43</html>