Re: Flexbox Tab-Index Recommendation

On 11/18/2014 12:27 PM, Bo J Campbell wrote:
> are you saying that the Flexbox is
> read into the DOM in the order that it is being visually laid out?

No -- DOM order is unchanged when the "order" property is modified.

Under the hood, separate from the DOM tree, most browser engines have a
"box tree" which represents the page layout (and which is topologically
similar to the DOM tree).  Gecko reorders this box tree to respond to
changes in "order".  As a side effect, this influences tab-index
handling, because we also use that box tree for determining tab ordering.

> Is there an argument that the tab index should not follow
> this visual order?

There was a thread about it on this list in 2012, starting with
  http://lists.w3.org/Archives/Public/www-style/2012Jun/0478.html

fantasai posted this proposal:
  http://lists.w3.org/Archives/Public/www-style/2012Jul/0046.html
...and it was discussed in the subsequent CSSWG meeting:
  http://lists.w3.org/Archives/Public/www-style/2012Jul/0109.html

(There was also a suggestion in that meeting that the property be
renamed; I didn't continue digging to see if/where that was followed up
on, but that's getting somewhat off-topic.)

(If you haven't read those threads yet, it's probably a good idea to go
through them when presenting your proposal.)

I think the argument was essentially:
 (1) Ideally, the source (& the DOM) should represent the page's logical
order, while the "order" property (and other flex properties) should be
used for purely visual reordering/reversing.

 (2) Non-visual navigation (like speech / screen-readers, and to a
lesser extent tab-index) should use the page's logical order. Hence,
they shouldn't be influenced by CSS-only "order" reordering.

There's also a chunk of the spec devoted to this:
  http://dev.w3.org/csswg/css-flexbox/#order-accessibility
with some explanation & an example of an article with a later-in-the-DOM
nav-bar, which is reordered to the article's left on a wide-enough screen.

~Daniel

Received on Tuesday, 18 November 2014 21:12:56 UTC