WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
23780
Populate title attribute for Image elements properly
https://bugs.webkit.org/show_bug.cgi?id=23780
Summary
Populate title attribute for Image elements properly
Sankar Aditya Tanguturi
Reported
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.
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
View All
Add attachment
proposed patch, testcase, etc.
Mark Rowe (bdash)
Comment 1
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.
Sankar Aditya Tanguturi
Comment 2
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.
Sankar Aditya Tanguturi
Comment 3
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. >
Mark Rowe (bdash)
Comment 4
2009-02-06 00:21:14 PST
***
Bug 23784
has been marked as a duplicate of this bug. ***
Mark Rowe (bdash)
Comment 5
2009-02-06 00:21:14 PST
***
Bug 23783
has been marked as a duplicate of this bug. ***
chris fleizach
Comment 6
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.
chris fleizach
Comment 7
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.
Sankar Aditya Tanguturi
Comment 8
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. >
chris fleizach
Comment 9
2009-02-06 16:59:16 PST
i think this will return the title <img title="Image title" src="picture.png">
Sankar Aditya Tanguturi
Comment 10
2009-02-06 17:02:38 PST
What about the case if the title attribute is not set by the developer for img tags?
chris fleizach
Comment 11
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
Eric Seidel (no email)
Comment 12
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.
chris fleizach
Comment 13
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.
Eric Seidel (no email)
Comment 14
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.
James Craig
Comment 15
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.
James Craig
Comment 16
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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug