-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Define focus behavior for <dialog>
element with Shadow DOM
#2393
Comments
On https://crbug.com/383230 I don't see any concrete suggestion of what the spec should do, except from comment 16 where it sounds like it's complicated. Spec prose aside, what is the most desired behavior here? |
I really hope someone is writing WPT tests for dialog inside a shadow tree. |
Tests will be needed to cover the eventual spec change, so that could be a good way to investigate current behavior and illustrate preferred behavior. (Such a PR would be left open until the spec change is reviewed.) |
i'd be happy to write a web platform test regarding the use of shadow DOM in |
Ah, I have found this discussion: #1929 @danbeam Yeah, wpt would be highly appreciated to understand a desired behavior. IMO, a sub tree of a dialog element and a document tree should not have any divergent behavior, regarding how focus works, e.g. how autofocus attribute works, or how sequential navigation (Tab-ing) works. We might also be interested in autofocus and Shadow DOM issue, #833, which has not got much attention recently. |
And #1175 seems an umbrella bug for Shadow DOM + |
We should simply change 'descendant' and 'tree order' in 'dialog focusing steps' to shadow-aware concepts, right?
Which one is preferable? |
I found Chrome's 'dialog focusing steps' implementation already applied flat tree. |
Right.
Given that autofocus normally uses "inserted into a document" and thus doesn't pierce shadow trees (which I assume is working as intended?), we should probably not use shadow-including. However, I'm unsure whether flat tree is the right choice here. Should we just use "normal" tree order? /cc @annevk @smaug---- |
I found #833 which contains some discussion on this point. It seems things are a bit more complicated. Should we try to treat dialog as if it has delegatesFocus? Maybe solving this should be blocked on implementing the consensus from #833? |
Ah, that's right. Searching shadow trees for autofocus in dialog.show() would be inconsistent.
Yeah, we should have a consistent solution for this and #833. |
Closes #2393, by making <dialog> behave the same as delegatesFocus: they both "delegate focus" to either autofocus="" if it's specified on a (non-shadow-including) descendant, or the first focusable element among their shadow-including descendants if not.
Closes #2393, by making <dialog> behave the same as delegatesFocus: they both "delegate focus" to either autofocus="" if it's specified on a (non-shadow-including) descendant, or the first focusable element among their shadow-including descendants if not.
Closes #2393, by making <dialog> behave the same as delegatesFocus: they both "delegate focus" to either autofocus="" if it's specified on a (non-shadow-including) descendant, or the first focusable element among their shadow-including descendants if not.
Closes whatwg#2393, by making <dialog> behave the same as delegatesFocus: they both "delegate focus" to either autofocus="" if it's specified on a (non-shadow-including) descendant, or the first focusable element among their shadow-including descendants if not.
Closes whatwg#2393, by making <dialog> behave the same as delegatesFocus: they both "delegate focus" to either autofocus="" if it's specified on a (non-shadow-including) descendant, or the first focusable element among their shadow-including descendants if not.
The dialog focusing steps algorithm doesn't define well about focusing behavior when Shadow DOM is involved.
See the context at crbug#383230.
The text was updated successfully, but these errors were encountered: