Closed tabatkins closed 10 hours ago
Thanks for summarizing. Note there is an existing issue on this topic: https://github.com/whatwg/html/issues/10533
Maybe we can put this as a comment on that issue and close this to avoid duplication?
Comment copied over, this issue can be closed.
What is the issue with the HTML Standard?
Currently, the reading-flow PR specifies that if a reading flow item is display:contents, then two things happen:
There was significant discussion on this behavior in the joint CSS/WHATWG meeting at TPAC about making this work better in several cases. Notably, it was considered bad if adding a "useless" 'reading-flow' value (applied to an element where DOM order and visual order are already consistent) could cause the reading order to now mismatch the visual order, because some of the items are in a display:contents subtree. For example, this markup:
Currently, has consistent DOM, visual, and tabbing order: A, B1, B2, C. But if we added
.flex { reading-order: flex-flow; }
, the tabbing order would change to A, C, B1, B2, despite the DOM order already matching the "flex-flow" order!Conclusions reached during the meeting:
display:contents
should not move to the end of the order as a "non-participating" item. Its children should go into the tabbing order according to their visual position as normal, according to whateverreading-flow
says.display:contents
element itself is focusable, it should go in the tab order immediately before the first of its children that are reading order items (according to thereading-flow
order). (So if you're tabbing backwards, it will be tabbed to after its first-per-reading-flow child.)display:contents
item shouldn't be a reading order scope container. If layout causes other elements to interleave between thedisplay:contents
item's children, tabbing order should follow the reading-flow order strictly.tabindex
is already possible to jump back and forth across these scopes, without actually reordering the a11y tree.