-
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
Add note on Shadow DOM behavior about dialog focusing steps. #2394
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this note seems OK, but will defer to @domenic who was already involved on crbug.com/383230
source
Outdated
@@ -56744,6 +56744,10 @@ interface <dfn>HTMLDialogElement</dfn> : <span>HTMLElement</span> { | |||
|
|||
</ol> | |||
|
|||
<p class="note">There is no well defined behavior about how focus works when Shadow DOM is used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like most links to problems in the HTML spec itself use <p class="warning">
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to warning class.
Add a warning that we don't have defined behavior of initial focus if Shadow DOM is used in <dialog> element.
5991151
to
5ebea7d
Compare
I don't think we should add a warning specific to dialog. The entire focus section right now does not take into account shadow DOM. There's nothing special about dialog; the same warning applies to every element. |
Okay, focus for Shadow DOM is not defined in the HTML spec, though patch exists in Shadow DOM spec - here, we don't have any definition to select control if Shadow DOM is involved in So does it make sense to change the warning as |
Leaving this to @domenic now since he has more context. |
No, I still think it makes no sense to have this warning be in the dialog section at all. There is no algorithm in the HTML spec for focus at all with shadow DOM. What we need is a warning saying that if you are looking at anything in the focus section, the HTML spec does not have a well-defined algorithm for dealing with shadow DOM. Dialog is not special. |
Yeah, I agree with @domenic that this warning is misleading given the focus navigation behavior isn't defined for all other cases involving the shadow tree. It's probably better to not add this, and spec the whole focus navigation ordering sometime later. |
Concretely, would it make sense to have a warning in https://html.spec.whatwg.org/multipage/interaction.html#focus and do we have a more generic issue than #2393 to link to? Or maybe rename that one? We don't have warnings for all outstanding warnings however, but as a test for when we could use one, any implementer wanting it seems fair. |
I don't think it's useful to have a warning about how things aren't spec'ed. We should be just writing specs, not adding warnings about how things aren't spec'ed. |
Thanks for your feedback. I'll withdraw this PR and defer the rest of the task to #1583. |
Add note on Shadow DOM behavior about dialog focusing steps.
Until we have consensus on defined behavior for Shadow DOM, any usage of Shadow DOM in
<dialog>
element is an undefined behavior and could break anytime.Filed an issue at #2393.