Subject: bug#16537: Use the title attribute for the tooltip, rather than the alt attribute.

From: [email-masked] (Adam Sjøgren)
Date: Sat, 25 Jan 2014 12:38:52 +0100

Lars Ingebrigtsen <[email-masked]> writes:

> [email-masked] (Adam Sjøgren) writes:
>
>> -         (put-text-property start (point) 'help-echo alt))
>> +         (when title (put-text-property start (point) 'help-echo title)))

> Well, it should display the alt text when there is no title, I think.
> I've applied that instead.

That is of course up to you - I disagree:

The alt text is only for when the image cannot be displayed, while the
title is for the text in the tooltip. Quoting the HTML-standard:

  "alt = text [CS]
     For user agents that cannot display images, forms, or applets, this
     attribute specifies alternate text. The language of the alternate
     text is specified by the lang attribute.

   Several non-textual elements (IMG, AREA, APPLET, and INPUT) let
   authors specify alternate text to serve as content when the element
   cannot be rendered normally. Specifying alternate text assists users
   without graphic display terminals, users whose browsers don't support
   forms, visually impaired users, those who use speech synthesizers,
   those who have configured their graphical user agents not to display
   images, etc."

    - http://www.w3.org/TR/html4/struct/objects.html#adef-alt

And:

  "title = text [CS]
     This attribute offers advisory information about the element for
     which it is set.

   [...]

   Values of the title attribute may be rendered by user agents in a
   variety of ways. For instance, visual browsers frequently display the
   title as a "tool tip" (a short message that appears when the pointing
   device pauses over an object)."

    - http://www.w3.org/TR/html4/struct/global.html#adef-title

Firefox and Chrome follows the standard, while Internet Explorer (as far
as I remember) does as shr (now) does.

Here is a quick HTML-page for testing:

 * http://asjo.org/misc/alt-title.html

  Best regards,

    Adam

-- 
 "Hur långt man än har kommit                                 Adam Sjøgren
  är det alltid längre kvar"                             [email-masked]