-
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
Remove concept of expressly inert? #7564
Comments
I think you are right and this concept is not good. And it is probably a remnant of control groups. But I wish I could figure out what the concept was even supposed to do, when control groups existed... why would it be useful to have the controls inside an inert dialog element be focusable? Something about nested modal dialogs?? I think if we fix this we can also clean up "When a key event is to be routed in a top-level browsing context, the user agent must run the following steps:", whose step 5 is pretty suspicious right now. Would you be willing to work on a pull request for this? |
It seems a remnant of control groups, which were removed in whatwg#3647. All uses are replaced with the concept of "inert". Also cleaning up "When a key event is to be routed in a top-level browsing context", which also seems to have remnants of when control groups allowed inert elements inside an inert dialog to be focusable. Fixes whatwg#7564.
It seems a remnant of control groups, which were removed in whatwg#3647. All uses are replaced with the concept of "inert". Also cleaning up "When a key event is to be routed in a top-level browsing context", which also seems to have remnants of when control groups allowed inert elements inside an inert dialog to be focusable. Fixes whatwg#7564.
PR in #7565
I have left the inert check since I guess it's technically possible for a DOM anchor of a focusable area to be inert in this case:
But I have removed the example. And I have changed steps 2 and 3, since "currently focused area of the top-level browsing context" returns a "focusable area-or-null". No need to check if it returns a dialog which is not a focusable area. |
It seems to be a remnant of control groups, which were removed in 90a60b2. All uses are replaced with the concept of "inert". Also clean up "When a key event is to be routed in a top-level browsing context", which seems to have remnants of when control groups allowed inert elements inside an inert dialog to be focusable. Fixes #7564.
It seems to be a remnant of control groups, which were removed in 90a60b2. All uses are replaced with the concept of "inert". Also clean up "When a key event is to be routed in a top-level browsing context", which seems to have remnants of when control groups allowed inert elements inside an inert dialog to be focusable. Fixes whatwg#7564.
It seems to be a remnant of control groups, which were removed in 90a60b2. All uses are replaced with the concept of "inert". Also clean up "When a key event is to be routed in a top-level browsing context", which seems to have remnants of when control groups allowed inert elements inside an inert dialog to be focusable. Fixes whatwg#7564.
https://html.spec.whatwg.org/multipage/interaction.html#expressly-inert
I was trying to understand if I implemented this right in Blink, but I don't really get the reasoning behind the concept.
The difference is that
while focusability typically requires not being "expressly inert" (so an inert element can be focusable if its document is inert).
There are different ways in which nodes can become inert:
If there is a modal dialog:
The DOM spec defines "connected" for elements, though it's used in nodes in general (
document.isConnected === true
). However, I don't think that we want to allow focusability of elements outside the modal dialog by marking the document node as inert. What I'm saying is according to implementations and what @domenic said in Should <dialog> actually create a "control group" for focus? #2171:So either the document node is not marked as inert by modal dialogs (so all inert elements are also expressly inert), or focusability should check inertness instead of expressly inert.
Nested browsing contexts:
So if I have an inert iframe, the elements inside it shouldn't be selectable, but should still be focusable? Why?
Seems specially puzzling since the nested viewport checks for plain inertness, so it won't be focusable:
The
inert
attribute (not yet in the spec and not shipped by implementations)It can only be set to elements so it's not relevant here.
I have checked #3647 and it seems that the "expressly inert" was formerly used for control groups, e.g.
But the "control group" concept was removed, so I think "expressly inert" should be removed too, and just check for "inert".
The text was updated successfully, but these errors were encountered: