Commit 57796844 authored by cfleizach@apple.com's avatar cfleizach@apple.com

Source/WebCore: AX: When img@alt is undefined, WebKit should use @title as...

Source/WebCore: AX: When img@alt is undefined, WebKit should use @title as accessibility label if available
https://bugs.webkit.org/show_bug.cgi?id=114535

Reviewed by Tim Horton.

Don't hide images from Accessibility that have the title attribute on them.

Test: accessibility/empty-image-with-title.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):

LayoutTests: When img@alt is undefined, WebKit should use @title as accessibility label if available
https://bugs.webkit.org/show_bug.cgi?id=114535

Reviewed by Tim Horton.

* accessibility/empty-image-with-title-expected.txt: Added.
* accessibility/empty-image-with-title.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d4eb0d39
2013-04-17 Chris Fleizach <cfleizach@apple.com>
When img@alt is undefined, WebKit should use @title as accessibility label if available
https://bugs.webkit.org/show_bug.cgi?id=114535
Reviewed by Tim Horton.
* accessibility/empty-image-with-title-expected.txt: Added.
* accessibility/empty-image-with-title.html: Added.
2013-04-17 Arpita Bahuguna <a.bah@samsung.com>
getAttribute does not behave correctly for mixed-case attributes on HTML elements
This tests that if a missing image has a title attribute, it still appears in the AX hierarchy.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS image1.role is 'AXRole: AXImage'
PASS image1.description is 'AXDescription: baz'
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<body id="body">
<img id="image1" src="foo.gif" title="baz" width="100" height="100">
<div id="console"></div>
<script>
description("This tests that if a missing image has a title attribute, it still appears in the AX hierarchy.");
if (window.accessibilityController) {
var image1 = accessibilityController.accessibleElementById("image1");
shouldBe("image1.role", "'AXRole: AXImage'");
shouldBe("image1.description", "'AXDescription: baz'");
}
</script>
<script src="../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2013-04-17 Chris Fleizach <cfleizach@apple.com>
AX: When img@alt is undefined, WebKit should use @title as accessibility label if available
https://bugs.webkit.org/show_bug.cgi?id=114535
Reviewed by Tim Horton.
Don't hide images from Accessibility that have the title attribute on them.
Test: accessibility/empty-image-with-title.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2013-04-17 Arpita Bahuguna <a.bah@samsung.com>
getAttribute does not behave correctly for mixed-case attributes on HTML elements
......@@ -1247,6 +1247,9 @@ bool AccessibilityRenderObject::computeAccessibilityIsIgnored() const
// informal standard is to ignore images with zero-length alt strings
if (!alt.isNull())
return true;
// If an image has a title attribute on it, accessibility should be lenient and allow it to appear in the hierarchy (according to WAI-ARIA).
if (!getAttribute(titleAttr).isEmpty())
return false;
}
if (isNativeImage()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment