WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 3 years ago

#14930 closed enhancement (wontfix)

Enable automatic longdesc for images

Reported by: mfields Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Accessibility Keywords: dev-feedback
Focuses: Cc:

Description

I attended WordCamp Portland and one of the sessions I sat in on had to do with accessibility. During the question and answer portion it was asked if anyone had seen a plugin that would enable a longdesc attribute to be generated for an image using the description field from the media library. No one had. I suggested that I had an answer and that it should be pretty easy to code. I tested my idea when I got home and created a successful plugin that enables the attribute to be appended as well as an html document to support it. Please see attached.

I really don't know the best way to handle this modifying core files. But I thought I would share the idea here in hopes that someone who is comfortable might be able to work it in.

Attachments (1)

longdesc.txt (2.3 KB) - added by mfields 5 years ago.

Download all attachments as: .zip

Change History (11)

@mfields5 years ago

comment:1 @mfields5 years ago

  • Type changed from defect (bug) to feature request

comment:2 @hakre5 years ago

Please upload it to the wordpress plugin repository: http://plugins.trac.wordpress.org/

comment:3 @nacin5 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Type changed from feature request to enhancement

comment:4 @mfields5 years ago

  • Cc michael@… added

comment:5 @Elpie4 years ago

It's a really common mistake to think that longdesc is the description for an image. It's not! longdesc takes a URI as a value - an URL to a file that contains a long description for an image. It’s not the description itself.

The problem with longdesc is that hardly anyone uses it and even fewer people use it correctly. Using it incorrectly is a barrier to accessibility. The proposed enhancement here would make images less accessible if browsers actually supported it. AFAIK. there is only one browser that offers any kind of support for longdesc. Even then, the longdesc cannot be discovered unless you use Opera with an Opera extension.

It's great to see people looking at improving accessibility but its important that changes comply with accessibility standards.

I'm opposed to this enhancement. longdesc cannot be automatically generated as it is something that is done at editing level by the content creator.

For more info: http://webaim.org/techniques/images/longdesc#methods

comment:6 follow-up: @mfields4 years ago

Elpie,

As Hakre suggested above, I bundled this into a plugin and uploaded to the plugins directory. Please take a look at how it works: http://wordpress.org/extend/plugins/long-description-for-image-attachments/

It adds the longdesc attribute to an image when the user adds it to a post. A url to the image's page is feed to the longdesc attribute with a custom query var which tells the plugin to load a "light" template for the query. You can see an example of this working on this page:

http://wordpress.mfields.org/2010/screenshot-of-the-new-taxonomy-widget-plugin/

The first image in the content section has a longdesc tag which points to a page that better describes the image. I believe that this is the intended use of the longdesc tag.

A solution similar to this is what I was proposing for core.

comment:7 in reply to: ↑ 6 @Elpie4 years ago

Replying to mfields:

Elpie,

As Hakre suggested above, I bundled this into a plugin and uploaded to the plugins directory. Please take a look at how it works: http://wordpress.org/extend/plugins/long-description-for-image-attachments/

It adds the longdesc attribute to an image when the user adds it to a post. A url to the image's page is feed to the longdesc attribute with a custom query var which tells the plugin to load a "light" template for the query. You can see an example of this working on this page:

http://wordpress.mfields.org/2010/screenshot-of-the-new-taxonomy-widget-plugin/

The first image in the content section has a longdesc tag which points to a page that better describes the image. I believe that this is the intended use of the longdesc tag.

A solution similar to this is what I was proposing for core.

The purpose of longdesc is to provide extended textual alternatives to image content, ie. it describes, in full, the image content. Here's an example: http://www.w3.org/WAI/wcag-curric/sam3-0.htm

However, it has several constraints that are difficult to handle programmatically. Firstly, there is currently no support for it outside of Opera. Secondly, accessing the long description cannot take the screen reader user away from the their position in the document containing the image where the description was invoked.

A blind user has to be able to choose how they interact with longdesc and the file containing the description must contain site navigation as well as a link back to the exact place in the page where they were before going to the description linked by longdesc.

Features added to core tend to get used, even by people who have no idea how they should be used. Currently, anyone wanting to include longdesc can do so by creating a page with the text equivalent of an image's content, adding the longdesc manually an image, adding an anchor on the original image for navigation back to that place, and adding the page as an exclusion in robots.txt to avoid having it indexed by search engines.

For these reasons, plus the fact that longdesc has been removed from the HTML spec, I feel it is plugin or content authoring territory and should not be added to core.

comment:8 @GaryJ4 years ago

I'd have to agree with Elpie here - with a lack of explicit browser support to do something useful with the longdesc attribute value, you'd be encouraging users to enter content that is barely available for the target sector, let alone everyone else. I bet most alt fields aren't complete, or description fields, and you want to add yet another field to core?

A plugin could add a field if necessary (or use the Description field), and perhaps output it in conjunction with a theme into a <details> element, with an aria-describedby attribute - this keeps the content contextual local to the image itself and available for everyone.

comment:9 @downstairsdev3 years ago

I agree this ticket should be closed wonfix, as longdesc is not in the HTML5 spec:
http://lists.w3.org/Archives/Public/public-html/2010Aug/att-0112/issue-30-decision.html

comment:10 @SergeyBiryukov3 years ago

  • Keywords needs-patch removed
  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.