Re: elements with presentational content

Yura wrote:

> Right, sorry, so lets say the inner element is legal - a span, for 
> example:
>
> <p>10:55<span>AM</span></p> 

In that case, the AT-SPI a11y tree for the paragraph is (omitting 
irrelevant states/properties):

- paragraph (zero childen):
-- name: none
-- accessible text:  "10:55AM"

> In the ideal use case the user should be able to navigate to the outer 
> paragraph and hear 10:55 AM. There is no need to step in into the 
> inner paragraph since the name of the outer one would've included the 
> sub-tree.

I'm not sure if your issue is about (1) navigation, (2) how screen 
readers handle this case, or (3) acquiring the text of the paragraph as 
a whole.

Regarding (3), the text is there in the a11y tree/API -- see above. For 
that matter, given a reference to the <p> element and using jQuery, one 
can get the paragraph text from the DOM (assume the paragraph has an 
@id="unit"):

jQuery("#unit").text(); // returns "10:55AM".

Regarding (1), and if you are talking keyboard navigation, then by 
giving the <p> element @tabindex="0", users can TAB navigate to the 
paragraph as a unit.  The focus ring will be around the entire 
paragraph.  If you don't want to use the TAB key but some other 
keystroke, give the paragraph a @tabindex="-1", and write some script to 
move focus to the paragraph based on that other keystroke.  For that 
matter, you should be able to move focus to the paragraph based on any 
gesture (cf.  IndieUI).  (Aside:  giving the paragraph a @tabindex is 
exposed it the a11y tree as having a focusable state).

Regarding (2), that's up to screen readers.  From what I can tell the 
information is there.  I know Orca has a "navigate-by-paragraph" mode, 
and I assume users can direct it to read the current. paragraph.  I 
don't actually know since I haven't found the time to test it.

Hope that's useful.

-- 
;;;;joseph.


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

Received on Friday, 30 May 2014 13:56:33 UTC