Page MenuHomePhabricator

Add ALT/accessibility text to <graph> tag
Closed, ResolvedPublic

Description

Basically, a screenreader won't even acknowledge the presence of these elements. This be bad. We need some form of 'alt text' for the image, or we can put alternative text inside the <canvas> element itself I think.

Also inquired upstream, to see if there has been any discussion about it already that we wouldn't know about.
https://github.com/trifacta/vega/issues/268

Implemented: alt='...' attribute takes its value from the title attribute:

<graph title='...'>...</graph>

becomes

<img alt='...' href='...'  />

Event Timeline

TheDJ raised the priority of this task from to Needs Triage.
TheDJ updated the task description. (Show Details)
TheDJ subscribed.

We could easily add an alt attribute to the <graph> tag. I would rather not touch the actual graph definition. For example, the wiki markup would be

<graph alt="World population growth per country">
{ .... }
</graph>

would generate

<div alt="World population growth per country"><canvas/></div>

or in case of an image (fallback or image only):

<img alt="World population growth per country" href="..." />

The spec actually advises:

<canvas>World population growth per country</canvas>

Examples: http://www.paciellogroup.com/blog/2012/06/html5-canvas-accessibility-in-firefox-13/

Yurik triaged this task as High priority.May 12 2015, 9:32 AM
Yurik set Security to None.
Yurik renamed this task from Graph extension is not accessible to users with visual impairments to Add ALT/accessibility text to <graph> tag.Jul 3 2015, 2:38 AM
Yurik added a project: good first task.
Yurik claimed this task.

Implemented this as an "alt" tag for now. Not sure how to add it inside <canvas> that gets generated by vega. Should probably be an upstream request if needed.

https://gerrit.wikimedia.org/r/#/c/263079/

Correction - currently alt='...' attribute takes its value from the title attribute:

<graph title='...'>...</graph>

becomes

<img alt='...' href='...'  />