[whatwg] Scoped tabindex proposal

Aaron Leventhal aaronlev at moonset.net
Fri Sep 1 07:00:37 PDT 2006

tabindex="-1" doesn't just remove items from the tab order. It also 
makes items focusable via mouse click or script, which is important when 
designing custom container widgets like spreadsheets, etc. via 
Javascript. In fact any negative value does it.

Don't try to overload the tabindex attribute. First, the browsers 
currently optimize it knowing that it's an integer. Second, the scoping 
is orthogonal. Third, magic values are less readable. It's voodoo.

- Aaron

Simon Pieters wrote:
> Hi,
> Currently if you want to use the tabindex to change the tab order you 
> mostly have to specify tabindex on all links and form controls prior 
> to the area you want to modify the tab order, because otherwise that 
> area would be before all prior elements in the tab order, which in 
> most cases isn't wanted. Therefore there's a need to scope tabindex 
> somehow.
> So here's an idea. A new value for the tabindex attribute, "scoped". 
> Here's an example:
>   <p>The following links should be focused in the order which the link 
> text indicates:
>   <p><a href="#">first</a>
>   <table tabindex="scoped">
>    <tr>
>     <td><a href="#" tabindex="1">second</a>
>     <td><a href="#" tabindex="3">forth</a>
>    <tr>
>     <td><a href="#" tabindex="2">third</a>
>     <td><a href="#" tabindex="4">fifth</a>
>   </table>
>   <p><a href="#">last</a>
> The table itself is not in the tab order and is not focusable.
> I'm not sure if we need another attribute or something for this 
> instead as .tabIndex is a long and not a DOMString. Or perhaps we 
> could say that all elements that have a tabindex attribute is a 
> scoping element, so that authors can use tabindex="-1" on the table 
> instead.
> Here's a pointer of where this (or something similar) is called for:
>   http://accessifyforum.com/viewtopic.php?t=6034
> Regards,
> Simon Pieters

More information about the whatwg mailing list