Bug 23780 - Populate title attribute for Image elements properly
Summary: Populate title attribute for Image elements properly
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 23783 23784 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-05 21:18 PST by Sankar Aditya Tanguturi
Modified: 2013-04-14 23:55 PDT (History)
4 users (show)

See Also:


Attachments
Patch to populate title attribute for image elements (5.31 KB, patch)
2009-02-05 21:47 PST, Sankar Aditya Tanguturi
eric: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sankar Aditya Tanguturi 2009-02-05 21:18:55 PST
When a web page is rendered in webKit and inspect32 tool is invoked, title attribute is not properly populated for Image tags.

Ideally, it should be set with the alternate text if any. (This behavior is observed in Firefox 2.0.0.14).

This patch is already approved by Jon as a part of bug 20013. I am logging this bug to track this specific issue separately.

~ Thanks
Sankar.
Comment 1 Mark Rowe (bdash) 2009-02-05 21:36:38 PST
For what it's worth, the title attribute of an element is currently returned as the title for accessibility purposes, while the alt attribute is used for the description.
Comment 2 Sankar Aditya Tanguturi 2009-02-05 21:47:20 PST
Created attachment 27380 [details]
Patch to populate title attribute for image elements

This patch is created to populate the title attribute for image elements properly.

~ Thanks
Sankar.
Comment 3 Sankar Aditya Tanguturi 2009-02-05 21:48:36 PST
In common practice, most of web-developers use alt attribute to give more information for image elements. Using alt attribute for populating title attribute makes more accessible.

~ Thanks.

(In reply to comment #1)
> For what it's worth, the title attribute of an element is currently returned as
> the title for accessibility purposes, while the alt attribute is used for the
> description.
> 

Comment 4 Mark Rowe (bdash) 2009-02-06 00:21:14 PST
*** Bug 23784 has been marked as a duplicate of this bug. ***
Comment 5 Mark Rowe (bdash) 2009-02-06 00:21:14 PST
*** Bug 23783 has been marked as a duplicate of this bug. ***
Comment 6 chris fleizach 2009-02-06 01:05:27 PST
i believe the alt value of an image is returned as the accessibilityDescription() from AccessibilityRenderObject. It shouldn't need to be returned as the title. 

This might be a Mac thing, but on the Mac, a title is only visible text. thus the alt tag would not be the title of an image (which does not have a title), but the description of the image.
Comment 7 chris fleizach 2009-02-06 01:07:45 PST
didn't realize there were other comments in this thread

If windows accessibility does not have a separate notion of description and title, then description (in this case the alt value) can be returned for the title attribute in windows-specific code. If there is a separate notion, then Mark is right, alt should not be used as the title.
Comment 8 Sankar Aditya Tanguturi 2009-02-06 16:56:24 PST
Populating title attribute is more accessible. And also, title attribute and description should be different. I understand my patch is not necessary. But, can you suggest me something for title attribute for image tags.

~ Thanks
Sankar.


(In reply to comment #7)
> didn't realize there were other comments in this thread
> 
> If windows accessibility does not have a separate notion of description and
> title, then description (in this case the alt value) can be returned for the
> title attribute in windows-specific code. If there is a separate notion, then
> Mark is right, alt should not be used as the title.
> 

Comment 9 chris fleizach 2009-02-06 16:59:16 PST
i think this will return the title

<img title="Image title" src="picture.png">
Comment 10 Sankar Aditya Tanguturi 2009-02-06 17:02:38 PST
What about the case if the title attribute is not set by the developer for img tags?
Comment 11 chris fleizach 2009-02-06 17:21:12 PST
if they dont' set a title, but do set an alt, then the image will have a description available through AX

it's up to the AX client to fetch both so that it can send them to the user depending on the user's settings
Comment 12 Eric Seidel (no email) 2009-05-04 01:22:03 PDT
Comment on attachment 27380 [details]
Patch to populate title attribute for image elements

How should this interact with the "title" element in HTML:
http://www.whatwg.org/specs/web-apps/current-work/#the-title-attribute

should alt= or title= be preferred if both are defined?

I've never seen role="img" before, so someone else will have to comment on if that behavior seems sane.
Comment 13 chris fleizach 2009-05-04 09:07:22 PDT
this patch is not needed. the alt tag for an image is returned in ::accessibilityDescription

if this patch is implemented, screen readers like VoiceOver will speak the alt tag twice because it will appear in the AXTitle and the AXDescription

the code on windows, (assuming it does not have an AXDescription type field that can be queried independently), should query first the title, and if it finds nothing, then query the description.
Comment 14 Eric Seidel (no email) 2009-05-19 20:35:58 PDT
Comment on attachment 27380 [details]
Patch to populate title attribute for image elements

r- per Chris's comments.

Your ChangeLogs also need your full name in future patches.
Comment 15 James Craig 2013-04-14 23:49:09 PDT
Is this bug still active? I'm confused by what Sankar means by the ~"title text" should be populated from the alt attribute. 

1. I think he means that the visible tooltip should use @alt if @title is null. If this is the purpose of his bug, I'm not sure there is a HTML backing for this, and I'd recommend closing the bug.

2. He might also mean that the ~"label text" or "accessible name" should be populated from @alt or @title. If so, HTML only specifies (and WebKit only supports) this via img@alt, but see bug 114535, which is to support img@title as the ~"label text" or "accessible name" according to the WAI-ARIA name computation when img@alt is undefined. If Sankar mean this, we could dupe this one out to bug 114535.

3. If Sankar means something else entirely, I think he should close this bug (the patch appears to be obsolete now) and re-file with a more clear explanation.
Comment 16 James Craig 2013-04-14 23:55:16 PDT
It occurred to me after I wrote the last comment that this is probably just cross-platform API confusion between the terms label/title/description which can all mean generally the same thing in different circumstances. That coupled with the HTML attributes and elements, alt/title/label, etc, make for a confusing read. 

I think this behaves correctly as img@alt is already exposed as the accessibility "description" and can be ported to different platform APIs as needed.

I'm going to close this bug due to the lack of activity. Re-open if the root problem is not addressed.