-
Notifications
You must be signed in to change notification settings - Fork 27
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
Addition: inert attribute mappings #410
Conversation
Note: I've been drafting updates to the HTML spec for the inert subtree/attribute section. I will reference that here when the PR is made. |
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.
Couple questions :)
@spectranaut thank you for the review |
cc @cookiecrook and @jcsteh for feedback and anything else you think needs to be called out in this spec for |
Hmm, so Edit: or at least a spec hook to do so, which html-aam can use to explain modal |
Demo of modal dialog inside In Chrome, Safari, Firefox, the button "show (in inert div)" is not clickable, but the "close" button in the modal dialog is. |
On Windows I get a different result: in Firefox both buttons are clickable and the inert area is fully passed to the Accessbility API |
Sorry, I meant Firefox Nightly. ( What I mean to show with the demo is that a modal |
index.html
Outdated
<p>A `dialog` element can escape an inert subtree when the `dialog` is in the modal state, and rendered in the browser's | ||
<a href="https://fullscreen.spec.whatwg.org/#top-layer">top layer</a> by use of the `showModal()` method. | ||
See also <a data-cite="html/interaction.html#modal-dialogs-and-inert-subtrees">Modal dialogs and inert subtrees</a>. |
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.
How should a <div role="dialog">
or a <div role="menu">
achieve the same?
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.
possibly by using the popover attribute, though i don't believe that functionality is available right now. we should open an issue for that separate from this.
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.
As I read it, popover is not intended for modals like <div role="dialog" aria-modal="true">
. The Dialog API is the only option for a modal. Regardless, I agree that's addressable as a separate issue.
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.
Right, ARIA would need a way of unhiding a child, see #410 (comment)
I can file a spec issue.
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.
You had filed one already :) w3c/aria#1256
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.
I'm now confused what you mean with your first message in this thread.
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.
dialog is the only element, when shown as a modal, which can escape its parent inert element and become re-exposed in the top layer.
so, per James's question, there is presently no way for someone to invoke an accessible ARIA dialog (modal or otherwise), or a menu if someone wanted to trap focus/screen readers in those elements, if it was contained within an inert container.
though popover is not allowed for HTML modal dialogs, the attribute does send an element to the top layer, so my mention of the attribute is that it could be a way for someone to do something like:
<div inert> <!-- attribute added when nested button is activated -->
<button aria-haspopup=menu ...>
invokes menu and sets parent to inert
</button>
<div role=menu popover ...>
<!-- menu items here and even though within an inert container,
since its in the top layer now, it COULD now be accessible -->
</div>
</div>
somewhere in some github thread that i've since lost track of, when implementation of inert was still being discussed, I had mentioned it would be great if inert=false
would un-inert a child node of an inert parent. I don't understand the rational as to why that wasn't entertained further, other than potential implementation complexity. But back to James's original question, because of that decision there is no way to do what James was asking with HTML now, and aria-hidden=false
wouldn't/shouldn't be expected to be a way to achieve this, as even if it did re-expose a part of the inert content, by itself it wouldn't undo the browser preventing click/focus to go to the aria-hidden=false content (as applicable if it were to consist of actionable elements)
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.
marking this thread as unresolved just to make sure this related discussion about inert/aria-hidden=false isn't missed by those being directed to this issue.
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 would be great if
inert=false
would un-inert a child node of an inert parent
Coming in very late, and obviously this has no bearing on the outcome of this PR, but I talked a bit about the rationale here: https://www.igalia.com/chats/alice-and-rob (you can search for "one way" in the transcript rather than listen to the whole rambling 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.
@alice thank you for the link and background!
@zcorpan per your previous comment
with linked example and
to my understanding that's already specified in HTML 6.3.1 Modal dialogs and inert subtrees - reference in this PR. So i don't think we need anything else? Re: your example contains a button and the dialog in the inert subtree, the dialog is spec'd to escape it. "subject escapes inertness of ancestors" so that's why the button, and its contents are accessible. followed on by the note
again, per my response in the comment thread with James, HTML could leverage this to allow popovers to also escape inert, since they too go to the top layer. But per your example and the button that invokes such elements being within an inert parent - this would likely require the topic of Edit: however i also realize i may be reading way too much into the note and what "this mechanism" really means. but if i'm wrong, maybe that could use some clarification? |
I think the HTML spec is correct about which nodes are inert and which are not, but this PR mapping the More correct would be to say something like "Nodes that are inert are not exposed to an accessibility API. Note: an inert node can have descendants that are not inert (e.g. a modal |
@zcorpan re:
will that be true for any other element aside from modal dialogs? my understanding is that's not true right now, and per my mention of Seems the PR could either be updated to specifically mention that if an element (a modal dialog) escapes being inert, then it should no longer be considered aria-hidden=true. Or, the PR is further adjusted to be more inline with your suggestion that inert doesn't directly map to aria-hidden=true, but it and its subtree behave similarly, but descendants of an inert parent can be marked as not inert - e.g., a modal dialog. @cookiecrook @aleventhal thoughts on the above? and specifically, are there any other platform mappings we'd need to note here if the attribute isn't just referring to aria-hidden's mappings in core aam? |
I think Simon's normative suggestion and first note are correct:
But I would not include the second note:
As that may change further with w3c/aria#1256 and the implementations don't currently align on that statement either. |
@scottaohara it might be true in the future if we introduce other ways to escape inertness. |
@cookiecrook @zcorpan thank you both. i'll work on getting this updated. should we actually update the ARIA spec to mention inert in https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion that seems it might be a good place for a longer explanation of how to handle inert / potential children which are no longer inert, which could then be linked to from html aam / other aams which might need it. |
incorporates feedback from @zcorpan and @cookiecrook
closes #295
add
inert
attribute and mappings.wondering if these need to call out that subtree elements should not be focusable re: their mappings, or if the comment here is sufficient? any other input on additional mappings that may need to be called out here are welcome.
Preview | Diff