Wcag: Definition and example for 'role' are confusing

Created on 13 Oct 2020  路  10Comments  路  Source: w3c/wcag

The current spec gives the following definition for role:

role
text or number by which software can identify the function of a component within Web content

With a single example:

A number that indicates whether an image functions as a hyperlink, command button, or check box

I cannot think of any real-world cases where role is represented as a number. It's unclear how this would even work, although I would _guess_ that in practise this would be some sort of enumerated type that maps numbers to roles?

The fact that the only example references numbers exclusively only adds to this confusion, and the example also references a list of only three possible roles (hyperlink, command button, or check box) whilst appearing to be exhaustive.

As I understand it, the definition is normative and thus hard (impossible?) to change, but the example is not? Given the example seems to raise more questions than it answers, would you consider replacing or removing it, or at least adding a second example that represents a more common use case?

If anyone is able to give me a steer on what sort of change makes most sense, I'd be happy to try and raise a PR.

Needs assigning WCAG 2.0 WCAG 2.1

Most helpful comment

is it so problematic to make a super small topical and non-controversial change? i thought the whole idea of being "agile" would be to be able to quickly make adaptations...

and i think the "in almost 15 years nobody complained" is perhaps more a sign that "in 15 years nobody bothered to read it from start to finish and try to make sense of it" ... or more likely they read it, were baffled, and then thought "ah well, who cares, it's not part of the SC text and that's all i need to worry about". because admittedly even I, having worked in the field for aeons, sometimes stumble across stuff in the dark corners of WCAG that i hadn't looked at that closely in all that time...

All 10 comments

On the face of it I agree, that seems like a very odd example.

Before you put the effort into a PR let us check whether there is some reasoning behind it which we don't know/remember. I wonder if @awkawk or @DavidMacDonald might remember?

In Microsoft Active Accessibility (MSAA) roles were constant values that represented control types.

Thanks Jon, but does it make sense to use that style of example in WCAG? Surely a simpler one like role="button" would be clearer?

I agree it could be cleaned up - I was just explaining the history of why it was that way. This was written pre-ARIA.

Does this really cause confusion? Even with no current examples, leaving this in seems appropriate in that it prevents a problem should some new web technology use constant values, and also if WCAG is applied to non-web technologies that do.

should some new web technology use constant values

FWIW it seems that the current trend in web standards is to shy away from cryptic number constants, and to instead favour string constants (from looking at most recent APIs in development)

if WCAG is applied to non-web technologies that do

that probably shouldn't be a primary concern for WCAG itself though

I'd go for clarity (and easily understandable prose) instead...

Given that this is the first time in almost 15 years I鈥檝e heard that this was causing confusion, and the person did understand the definition clearly personally, so I think that this is super low priority and should be considered for WCAG 3.0.

is it so problematic to make a super small topical and non-controversial change? i thought the whole idea of being "agile" would be to be able to quickly make adaptations...

and i think the "in almost 15 years nobody complained" is perhaps more a sign that "in 15 years nobody bothered to read it from start to finish and try to make sense of it" ... or more likely they read it, were baffled, and then thought "ah well, who cares, it's not part of the SC text and that's all i need to worry about". because admittedly even I, having worked in the field for aeons, sometimes stumble across stuff in the dark corners of WCAG that i hadn't looked at that closely in all that time...

@alastc et al., I would guess that role possibly being a numeric reference goes back to the earliest days of programming. I can't think of a more precise example, but I remember there being sometimes being problems with menus (or other elements) being numeric references (in the source code) and screen readers at the time exposing the number but not what the number represented. This may have even been before MS Windows. Thank you @mraccess77 for the MSAA example, which I think is exactly what inspired the original phrasing.

Thanks for the context, folks.

It sounds in principle we're open to changing this, so I'd like to try and put together a PR to address this. Am I right in thinking that only the example in the yellow box can change, as the role definition itself is normative?

Was this page helpful?
0 / 5 - 0 ratings