Re: Structured HTML Precludes aria-posinset and aria-setsize?

> If a tree is structured with the HTML elements for nested lists,  
> namely <ul>
> and <li>, these attributes become redundant?
>
> * setsize is available by counting the <li> at the current level.
> * posinset is available by counting the <li> at the current level up  
> to and
> including the current <li>.

Indeed, setsize/posinset don't appear to have a very HTML-like design.

I can think of two cases where counting the number of child elements  
of the container is not enough:
  1) Paged views (e.g. showing 20 messages of a mailbox containing  
thousands of messages and having only the 20 items in the DOM)
  2) Tree grids implemented as <table>s where some rows should not  
participate in the top level item count.

In both cases, I can think of a more author-friendly and HTML-like  
design.

In case #1, the container element needs two attributes: start and  
total. The position in set for a given item would be start + the  
number of previous element siblings. If start < 1 or missing, assume  
1. (One-based start as opposed to zero-based offset is consistent with  
<ol start>.) The attribute total gives the set size. If missing or if  
start + number of element children in the container - 1 > total, use  
start + number of element children in the container - 1 instead.

In case #2, rows in <thead> and <tfoot> should be ignored for the  
count as well as rows flagged as subrows.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Friday, 28 March 2008 17:51:20 UTC