44 lines
1.5 KiB
HTML
44 lines
1.5 KiB
HTML
<!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 id="body">
|
|
|
|
<img id="realimage" tabindex="0" alt="TestImage" width="100" height="100">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
|
|
<image tabindex="0" id="svgimage" alt="TestImage" x="20" y="20" width="298" height="65" xlink:href="resources/cake.png"/>
|
|
|
|
</svg>
|
|
|
|
<p id="description"></p>
|
|
<div id="console"></div>
|
|
|
|
<script>
|
|
|
|
description("This tests that SVG images are accessible elements and they have the same attributes as real images.");
|
|
|
|
if (window.accessibilityController) {
|
|
document.getElementById("realimage").focus();
|
|
var realImage = accessibilityController.focusedElement;
|
|
|
|
document.getElementById("svgimage").focus();
|
|
var svgImage = accessibilityController.focusedElement;
|
|
shouldBe("svgImage.role", "realImage.role");
|
|
shouldBe("platformValueForW3CName(svgImage)", "platformValueForW3CName(realImage)");
|
|
shouldBe("platformValueForW3CDescription(svgImage)", "platformValueForW3CDescription(realImage)");
|
|
|
|
debug("SVG Image Role: " + svgImage.role);
|
|
debug("SVG Image Accessible Name: " + platformValueForW3CName(svgImage));
|
|
debug("SVG Image Accessible Description: " + platformValueForW3CDescription(svgImage));
|
|
}
|
|
|
|
</script>
|
|
|
|
<script src="../resources/js-test-post.js"></script>
|
|
</body>
|
|
</html>
|