AX: WebKit ignores @alt on IMG elements with role="text"
https://bugs.webkit.org/show_bug.cgi?id=125363

Reviewed by Mario Sanchez Prada.

Source/WebCore:

If an <img> element has a different role, the alt attribute should still be used in the
name calculation if present.

Test: accessibility/alt-tag-on-image-with-nonimage-role.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::usesAltTagForTextComputation):
(WebCore::AccessibilityNodeObject::alternativeText):
(WebCore::AccessibilityNodeObject::accessibilityDescription):
(WebCore::AccessibilityNodeObject::text):
* accessibility/AccessibilityNodeObject.h:

LayoutTests:

* accessibility/alt-tag-on-image-with-nonimage-role-expected.txt: Added.
* accessibility/alt-tag-on-image-with-nonimage-role.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6 files changed