Re: Element.getComputedRole()

Depends on what you call an an a11y-only use case. 

For example, a script to focus the first button (ARIA button or native) in a dialog?

  document.getElementBySelector(":role(dialog)")[0].getElementsBySelector(":role(button)")[0].focus();

Or by using one selector to style all the headings:

  *:role(heading)
   /* Mostly equivalent to "h1, h2, h3, h4, h5, [role=heading]" */
  /* but the :role() selector catch some additional headings, like <div role="foo heading"> */
  /* and the expanded selector would mismatch some others, like <h1 role="none"> */

> On Nov 11, 2014, at 10:32 AM, Alexander Surkov <surkov.alexander@gmail.com> wrote:
> 
> a11y stuff in CSS is interesting idea but that shouldn't require Element interface extension. Do I understand right that there are non a11y use cases for a11y properties? Is it restricted to a11y role property only?
> 
> On Mon, Nov 10, 2014 at 2:42 PM, James Craig <jcraig@apple.com <mailto:jcraig@apple.com>> wrote:
> 
> > On Nov 10, 2014, at 11:08 AM, Alexander Surkov <surkov.alexander@gmail.com <mailto:surkov.alexander@gmail.com>> wrote:
> >
> > Are there any summary of pros and cons from the discussion? I still not sure that DOM Element is a right place to host accessibility methods.
> 
> The primary argument was that role is useful outside the context of accessibility. The new CSS :role() selector is one example of that.
> 
> 
> 

Received on Wednesday, 12 November 2014 04:18:12 UTC