Skip to content

Relationship between popover and children/shadow root in focus navigation is unclear #12871

Description

@ltenmoz

What is the issue with the HTML Standard?

Consider a case such as

<div id=source tabindex=0>source <a href="#">link in source</a></div>
<div id=popover popover><a href="#">link in popover</a></div>
<script>
popover.showPopover({source});
</script>

According to the current spec, AFAICT the order of link in source vs link in popover in focus navigation "should" be the same as the shadow-including tree order (https://html.spec.whatwg.org/#tabindex-value:~:text=area%2E-,The%20relative,order%2E). However, this doesn't make much sense - the position of the popover in the tree shouldn't matter when determining its order in focus navigation.

The situation is similar if source has a focusable element in its shadow root instead of as a child.

I think we want to say that the popover contents always should come before any children or shadow root of the source in focus navigation order (or, perhaps we can replace "before" with "after", not sure which is better).

Currently, Gecko skips the children/shadow root of the popover source (although this may be fixed as part of https://bugzilla.mozilla.org/show_bug.cgi?id=2067629), and Chromium/WebKit both follow the previous paragraph for children of the source. For shadow roots, WebKit is also buggy (skips popover in focus navigation), and Chromium follows the previous paragraph but with s/before/after/. I think it makes more sense to have shadow roots vs children be consistent, though.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions