Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<dialog> should be able to focus the previously focused element in other frames #9854

Open
sefeng211 opened this issue Oct 13, 2023 · 3 comments
Labels
topic: dialog The <dialog> element. topic: focus

Comments

@sefeng211
Copy link
Contributor

sefeng211 commented Oct 13, 2023

looking at the spec for <dialog>, Set this's previously focused element to the focused element doesn't account the case where the current focused element is in a different same-origin frame. We should be able to allow moving focus to that.

Apologies since I added this line. I am not sure the correct wording to fix it.

@sefeng211 sefeng211 added the topic: dialog The <dialog> element. label Oct 13, 2023
@annevk
Copy link
Member

annevk commented Oct 16, 2023

I think you want to use https://html.spec.whatwg.org/#currently-focused-area-of-a-top-level-traversable and then do a same-origin check on the resulting focusable area's DOM anchor's document's origin maybe?

@sefeng211
Copy link
Contributor Author

That algorithm is confusing to me. It says traversable is the focusable area-or-null returned by this algorithm and the step one talks to traversable straightly, but what traversable is at the moment?

@annevk
Copy link
Member

annevk commented Oct 16, 2023

https://html.spec.whatwg.org/#top-level-traversables (it's roughly a top-level browsing context, but different due to COOP+COEP iirc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: dialog The <dialog> element. topic: focus
Development

No branches or pull requests

2 participants