Re: Change proposal for ISSUE-85

On Wed, 16 Jun 2010, Jonas Sicking wrote:
> 
> Couldn't this line of reasoning be applied to all elements, resulting in 
> no elements being defined as having "strong semantics"?

I agree that this seems like a slippery slope.

Here's another explanation of why I think allowing role="button" on <a> 
would be a mistake:

Consider the cases where role="button" could be specified on an <a> 
element. There are the following relevant axes, I believe:

* The author may care about conformance (i.e. use a validator) or not care 
  about conformance (i.e. not use a validator).

* The <a> element could be styled as a link or styled as a button.

* The <a> element could be semantically a hyperlink or it could be 
  semantically an actionable widget.

* The author might be willing to spend the effort to fix the page 
  properly, or they might only be willing to spend the time to make the 
  minimum possible changes.

Now, all the cases where the author doesn't care about conformance (and 
doesn't use a conformance checker) are irrelevant here, since they won't 
find out that what they're doing is wrong, and it'll work as expected, 
since we have defined error handling.

In the case where the <a> element is styled as a link, role=button would 
make the accessibility worse and therefore catching it would be a good 
thing. For this case, role=button being conforming is a negative.

This leaves the following four cases:

  The <a> element is semantically a hyperlink but it is styled as a 
  button, and the author is willing to spend the effort to fix the page 
  properly.

  The <a> element is semantically an actionable widget and it is styled as 
  a button, and the author is willing to spend the effort to fix the page 
  properly.

  The <a> element is semantically a hyperlink but it is styled as a 
  button, and the author is only willing to spend the time to make the
  minimum possible changes.

  The <a> element is semantically an actionable widget and it is styled as 
  a button, and the author is only willing to spend the time to make the
  minimum possible changes.

In the first two, having the validator flag these cases and suggest using 
<button> or <input> instead again is a win, since it improves 
accessibility for users of non-AT, non-stylable UAs.

In the third case, styling it as a button is bad UI. An AT user is 
actually better off not knowing that the link is styled as a button -- the 
page will be more accessible for AT users (and users of non-AT, 
non-stylable UAs) than for users of graphical browsers if we disallow 
role=button in this case.

Finally, this leaves the fourth case, where someone has used <a> instead 
of the more appropriate <button>, and styled their <a> to look like a 
button, and refuses to fix their markup except for adding role=button. Are 
there such pages? Does anyone have any URLs demonstrating the existence of 
this case at all?

I'm not convinced that even if this case exists it outweighs the 
advantages of disallowing it for the other cases, since we're only talking 
about existing pages and we're talking about authors who aren't willing to 
do much work anyway, but if they don't exist at all then this tradeoff is 
a moot point. Do these pages exist?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 16 June 2010 08:58:54 UTC