Page MenuHomePhabricator

Use WAI-ARIA landmark roles to improve accessibility
Closed, ResolvedPublic


Author: peter.krantz

WAI-ARIA landmark roles for Monobook skin

The W3C WAI-ARIA specification defines a set of specialised "landmark"
roles. These roles provide a method to programmatically identify commonly found
sections of web page content in a consistent way. This allows assistive
technologies (e.g. a screen reader) to provide users with features which they
can use to identify and navigate to sections of page content.

Landmark roles are specified with the role attribute in HTML. In order to keep
the template markup valid (when testing with the W3C markup validation service)
this patch adds landmark role data with a small javascript after the page has

For more information on WAI-ARIA landmark roles see:

Using WAI ARIA landmark roles by Steve Faulkner:

and the WAI-ARIA specification.


Peter Krantz

Version: unspecified
Severity: enhancement
See Also:

attachment monobook_wai-aria_landmark_roles.diff ignored as obsolete



Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:35 PM
bzimport set Reference to bz18338.
bzimport added a subscriber: Unknown Object (MLST).

Please provide this for all skins. We do not want the functionality of the skins to deviate.

bug 24659 asks for WAI ARIA stuff to be allowed in wiki text. That may help with allowing it for skins, too.

jp.posma wrote:

WAI-ARIA landmark roles

In fact these landmark roles can be used for all skins. Included them in mediawiki.utils.js.

Apply to trunk/phase3.


Any reason we're not hardcoding them? Afaik, a few screen readers ignore Javascript

peter.krantz wrote:

(In reply to comment #4)

Any reason we're not hardcoding them? Afaik, a few screen readers ignore

Screenreders do not ignore javascript, but it is better to code them straight into the HTML. Only problem is with sensitive people who favor validation above accessibility therefore the javascript.

But real attributes in markup is a better option.

Doing this straight in the HTML would indeed be better, though the JS should usually work.

We should however actually research *AND TEST* this with actual screen readers.

ayg wrote:

We should definitely add this to the HTML output, not just via JS. The role attribute is valid in HTML5. I'd also say we should test this with actual screen readers before adding the roles, though, to make sure we understand what effect they're having.

sumanah wrote:

Jan Paul, do you have time to revise the patch to integrate the review and suggestions here?

I've created a change that add these role directly in skins:

It's not valid in XHTML 1.0 but jQuery UI already use it without any problem.

(In reply to comment #9)

I've created a change that add these role directly in skins:

Status Merged

Potential regression of this commit: see bug 42394.
Thomaspt: Could you take a look?