Re: [css3-ui] nav-index <number> value

On Oct 18, 2012, at 5:29 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Thu, Oct 18, 2012 at 5:26 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
>> On Oct 18, 2012, at 10:24 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:
>>>> in the tab order with a 'nav-index:1.5'. Or before the first one with a 'nav-index:0.5'.
>>> 
>>> I agree, actually.  However, then we should modify more of the
>>> property.  We can't make it "positive numbers", because that's an open
>>> range, and we avoid those when possible.  There's a legitimate reason,
>>> for this property, to keep a "non-negative" restriction, though -
>>> ideally, you shouldn't have to scan the entire document to find out
>>> what the first element in tab order is, at least in the common case.
>>> So, having a minimum value (either 0 or 1) that's the default makes it
>>> possible to just jump to the first element with that value.  It's
>>> unfortunate that this means you can't put an element in front without
>>> moving *all* the other elements, but that's a tradeoff.
>> 
>> You have to scan the whole document anyway, to find out what the second element is. It might be 'nav-index:50000'. You don't need to know either one until someone tabs, Tab, and by that time you've likely assigned styles to all elements and know their tab order already anyway.
> 
> Not quite - you only need to resort to waiting for the rest of the
> document when you run out of elements with the lowest value.  As long
> as there are some of them left, you're good.

That still seems like having a set lowest value is not gaining much. Like any other property, you still parse the CSS and assign styles to elements. At that point you know the CSS tab order and which nav-index number is the lowest; it's not a complex computation. And you're probably getting the HTML tabindex around the same time (which has a minimum of 1, right?), as you're walking the DOM assigning styles. So I don't see what the big deal is, or why it is a bigger deal than any other CSS property. 

Received on Friday, 19 October 2012 15:16:01 UTC