The W3C spec <img> says that the alt attribute on images is "#REQUIRED". The How to specify alternate text further says

Do not specify irrelevant alternate text when including images intended to format a page, for instance, alt="red ball" would be inappropriate for an image that adds a red ball for decorating a heading or paragraph. In such cases, the alternate text should be the empty string ("")

Based on that, I think the theme_image function should add an empty alt attribute when none other is specified.

Members fund testing for the Drupal project. Drupal Association Learn more


Letharion’s picture

Eric_A’s picture

Calling theme_image() will already return markup with the empty string alt attribute value. This default is declared in a hook_theme() implementation. See system_theme() and drupal_common_theme().

Letharion’s picture

Status: Active » Closed (works as designed)

Ops, my bad.