merge_pr_48611
[reading-flow] display: contents participate in the flow
From CSSWG resolution [1]:
display:contents focusable element occurs immediately before its first child in visual order
[1] w3c/csswg-drafts#9230 (comment)
Currently, reading flow items in display: contents are ignored and
display: contents elements are visited last in the focus order.
That means we lose that order information.
We update the algorithm so when we loop reading items and find one that
is not in the focus scope, we traverse its parent to find an ancestor
that is. This element can then be added in the reading flow instead.
We update A11Y to behave the same way as focus navigation. Since the
A11Y tree uses LayoutTreeBuilder, we update the algorithm to loop
through each reading flow item's ancestor until its parent is the
LayoutTreeBuilderTraversal::Parent. This element can then be added in
the reading flow instead.
Change-Id: I1c3c3ab3a6548611af9a2cfddecc9d889b0ecb14
Bug: 371024057
Bug: 40932006
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5924454
Commit-Queue: Di Zhang [email protected]
Reviewed-by: Mason Freed [email protected]
Cr-Commit-Position: refs/heads/main@{#1368523}