Simon Pieters wrote:
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.
The table might not be focusable, but it needs to be in the tab order in
some sense in order to resolve that local tabindex="1" into a global
tabindex.
For example:
<a id="outside1" href="..." tabindex="1">...</a>
<div tabindex="scoped" id="container1">
<a id="inside1" href="..." tabindex="1">...</a>
</div>
<div tabindex="scoped" id="container2">
<a id="inside2" href="..." tabindex="1">...</a>
</div>
<a id="outside2" href="..." tabindex="2">...</a>
What is the global tab order now?
I could see arguments for either:
#outside1
#inside1
#inside2
#outside2
(DOM order)
or...
#outside1
#outside2
#inside1
#inside2
(all of the explicit tabindexes first in index order, followed by
everything else in DOM order)
Now what if I want the elements of #container2 to be before those of
#container1 in the tab order? Can I also give these DIVs a tabindex?