[wp-trac] [WordPress Trac] #8256: Caption and alternative text should not be the same
WordPress Trac
wp-trac at lists.automattic.com
Sat Oct 10 10:23:28 UTC 2009
#8256: Caption and alternative text should not be the same
------------------------------+---------------------------------------------
Reporter: frankie-roberto | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone: 2.9
Component: Gallery | Version: 2.8
Severity: normal | Resolution:
Keywords: has-patch tested |
------------------------------+---------------------------------------------
Comment(by bobeaston):
Sam,
You beat me to the job of resolving this issue. I've just been looking at
media.php.
Yes, your fix is more consistent with HTML 5, but it is also very valid
for HTML 4 and for [http://www.w3.org/TR/UNDERSTANDING-WCAG20/text-equiv-
all.html /WCAG 2]. It is perfectly valid for alt="" when the image is not
essential to understanding, such as a decorative or "eye candy" images,
spacer gifs, etc. The entire difficulty with trying to make a choice
automatically is that no machine understands how to answer "Is the image
essential?"
Your code is almost OK, but does not fix the current problem. In fact, in
one circumstance it can produce an undesirable outcome.
Your code depends on alt text already existing. Where does that alt text
come from? There's no entry field for alt in the upload form. The only
place a person can currently add legitimate alt text is on the very
obscure "Advanced Settings" form of the edit image code.
Currently media.php offers entry fields only for title and caption on the
upload form. media.php then populates $alt with the return from the
caption entry field, and then copies that value into the caption
shortcode. So, you see, alt is virtually guaranteed to be identical to
caption. If someone had consciously crafted the caption to be useful alt
text, your change makes it null, the unwanted outcome.
As an accessibility consultant (my professional job for many years), I
would resolve the problem in the upload form, the first thing the typical
user sees. There, I would:
1. Add a radio button with yes/no values and the question "Is the image
essential to understanding?"
2. Offer an input field for alternative text with help that says
"Describes the image when it can’t be seen." I would also add a -more-
link to the help text pointing to
[http://codex.wordpress.org/Accessibility#Describe_Images_and_Links /an
excellent codex page].
3. Mark the alternative text entry field with an asterisk, denoting
required, and add the aria required attributes.
4. Populate $alt with either provided text or with null dependent on how
the "essential" question was answered.
5. Remove the required asterisk from the title entry field and change its
help text to "Additional information. Appears as hover / tooltip text."
6. Change the help text for the caption field to "Yet more information –
i.e. photo credit."
7. Assign the value entered for caption to the caption shortcode instead
of assigning it to $alt first.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/8256#comment:17>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list