Re: Regarding the accessible name calculation for aria-label within links?

Hi Sailesh,

> But how should the following be interpreted:
> <span role="listitem" aria-label="I am a listitem">What is my <a
> href="#" aria-label="name">nom de plume</a>?</span>

I am unsure what you are asking when you say "how should the following 
be interpreted".  That depends on who is doing the interpreting :-) .

I'll start with a given.  The aria spec mandates that the browser 
exposes the following accessibles and their names through the a11y API 
for your markup.  Accessibles are given in upper case.  The tree is 
based on FF 27 as viewed using an a11y inspector (apologies if the tree 
structure is not apparent):

LIST_ITEM {
     name: "I am a listitem"
     TEXT {
         name: "What is my"
     }
     LINK {
         name: "name"
         TEXT {
             name: "nom de plume"
         }
     }
     TEXT {
         name: "?"
     }
}

> And my take is:
> The identity of the SPAN is: "I am a listitem"

If, by "identity", you mean the a11y name, I agree.  Otherwise, what do 
you mean by "identity"?

> So this should be exposed to the browser and ATs should render it as
> one navigates to the SPAN i.e. list item.

I think you mean "exposed *by* the browser?  If so, yes.

> And the content of the SPAN too should be exposed as you suggested earlier:
> "What is my name?"

This raises an interesting point.  In my example, the a11y *name* of the 
LIST ITEM was "What is my name?".  I was showing that a 
name-from-contents calculation could switch to name-from-author for a 
single descendant element, and then switch back.  I said nothing 
specifically about the *contents* of the LIST ITEM.

Based on the above a11y tree, the contents of the LIST ITEM is exposed 
as "What is my nom de plume?".  But, that's based on the assumption that 
the contents are built out of the TEXT accessibles. Note that matches 
the content that the browser renders on screen.

So:  I disagree that the content of the LIST ITEM is "What is my name?".

> And browsers and ATs should render this.

Well, as I said, the browser renders "What is my nom de plume?" as the 
content of the list item, not "What is my name?"  I think ATs should 
render the same content, here.  I don't see a reason for ATs to render 
different content.  However, a position in this thread is that ATs 
reserve the right to do what they want.  Perhaps there is a 
justification for rendering the content differently as "What is my 
name?", but, if there is such justification in this case, it escapes me.

Here's a use case:  a screen-reader/magnifier user.  The magnifier 
presents an enhanced version of what the browser has rendered on screen, 
namely "What is my nom de plume?".  If, at the same time the screen 
reader speaks something different, say, "What is my name?", that is 
going to confuse the user.

By the way, if it's not obvious, the browser does not explicitly render 
the a11y names on screen.  The names exist only in the a11y API.

-- 
;;;;joseph.


'A: After all, it isn't rocket science.'
'K: Right. It's merely computer science.'
              - J. D. Klaun -

Received on Friday, 14 February 2014 22:09:59 UTC