[reading-flow] Implement tabindex behavior
Per explainer [1], we update the reading-flow scope tabindex behavior:
- On the "reading flow items", tabindex is ignored for ordering
purposes.- If tabindex is higher than 0, adjust it to 0 for scoped focus
navigation purposes.
- If tabindex is higher than 0, adjust it to 0 for scoped focus
- On the descendants of the "reading flow items", tabindex's ordering
behavior is scoped to that reading flow item subtree.- The reading flow items are scope owners.
[1] https://github.com/dizhang168/reading-flow/blob/main/reading-flow-vs-tabindex.md
We also remove the helper functions NextReadingFlowItem and
PreviousReadingFlowItem because the spec rules above simplify the
reading flow scope traversal and we do not need to visit descendants.
Change-Id: Ie1f24685d1b38fd64d06dc7d7945bb476d636f7a
Bug: 371024056
Bug: 40932006
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5950103
Reviewed-by: Mason Freed masonf@chromium.org
Commit-Queue: Di Zhang dizhangg@chromium.org
Cr-Commit-Position: refs/heads/main@{#1374224}