Bug 23979: AX: alt tag not returned for <input type="image">
https://bugs.webkit.org/show_bug.cgi?id=23979
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index faf0668..35785ff 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2009-02-16 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ Test for Bug 23979: AX: alt tag not returned for <input type="image">
+ https://bugs.webkit.org/show_bug.cgi?id=23979
+
+ * accessibility/input-image-alt-expected.txt: Added.
+ * accessibility/input-image-alt.html: Added.
+
2009-02-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
diff --git a/LayoutTests/accessibility/input-image-alt-expected.txt b/LayoutTests/accessibility/input-image-alt-expected.txt
new file mode 100644
index 0000000..942df1a
--- /dev/null
+++ b/LayoutTests/accessibility/input-image-alt-expected.txt
@@ -0,0 +1,3 @@
+
+Test passed
+
diff --git a/LayoutTests/accessibility/input-image-alt.html b/LayoutTests/accessibility/input-image-alt.html
new file mode 100644
index 0000000..373c5d4
--- /dev/null
+++ b/LayoutTests/accessibility/input-image-alt.html
@@ -0,0 +1,32 @@
+<html>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<body id="body">
+
+ <!-- This test makes sure that an input image returns its alt tag as the description -->
+
+ <input type="image" alt="Submit" src="resources/cake.png" width=100 height=100 id="image1">
+
+ <div id="result"></div>
+
+ <script>
+ if (window.accessibilityController) {
+ var result = document.getElementById("result");
+
+ var image1 = document.getElementById("image1");
+ image1.focus();
+ var img = accessibilityController.focusedElement;
+
+ var pattern = "Description: Submit";
+ if (img.allAttributes().indexOf(pattern) != -1) {
+ result.innerText += "Test passed\n";
+ }
+ else {
+ result.innerText += "Test failed\n";
+ }
+ }
+ </script>
+</body>
+</html>