-
Notifications
You must be signed in to change notification settings - Fork 125
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
Clarify "required owned element" #1033
Comments
In this context, it should be clarified whether all child elements that do not belong to the required owned elements automatically have role=presenation implicitly or not. If this is always the case, this should be added to the specification when defining required owned. If this is not always the case, it should be explicitly specified for each role whether it is the case or not. Currently, it is handled differently by the browsers depending on the role and element:
Results (with IE 11 and Chrome, JAWS 2019): role=listh3 and checkbox: not a list item, but part of the list ulh3 and checkbox: not a list item, but part of the list role=tableh3 and checkbox: not a table cell, but part of the table tableh3 and checkbox: not part of the table role=listboxh3 and checkbox: ??? selecth3: part of the select, but no output tablisth3 and checkbox: not a tab, for me not determinable, whether part of the tablist |
Perhaps it is better not to define the required elements, but the permitted ones. Then one avoids the problem that e.g. an empty selection list is possible in HTML, but not in ARIA. See w3c/aria-practices#468 (comment) |
@jnurthen I want to reraise this issue as part of my feedback on the wide review draft. I would appreciate an explanation of why this is not being addressed in ARIA 1.2. A simple clarification would be sufficient, as to whether or not "required owned elements" means all owned elements need to be of the given type, or if it permitted that other elements can be owned, as long as one of the owned elements is of the permitted type. |
Change is motivated by issue w3c#1033
@jnurthen Would it be possible to get an explanation of why this will not be addressed in WAI-ARIA 1.2? I think there is a substantial problem in the way "required owned element" works. At least one of the following patterns is not valid, but it isn't clear which one. Both of them seem completely reasonable to me: List without content: <label>
Todo: <input type="text">
</label>
<button>Add</button>
<ul id="todo-list"> <!-- empty until a user adds something --> </ul> Radiogroup with some radiobuttons: <div role="radiogroup" aria-label="Search options">
<input type="radio" id="restrict">
<label for="restrict">English</label>
<input type="radio" id="university" checked>
<label for="university">University</label>
</div> This second one is borrowed from an issue in the ACT-rules repo (act-rules/act-rules.github.io#1426). |
@WilcoFiers Apologies - I saw your comment yesterday, forgot that you already provided a PR, and I typed something up and created a new PR. I will look through your PR, re-read all of the comments above, and probably delete my new PR... but maybe there are some words that can be incorporated. Will let you know. |
@WilcoFiers
I think your PR solves 1, but not 2 or 3? So, keeping in mind the definition of Owned Element:
how about the following:
Notes:
|
@carmacleod Thanks for looking into this. You are right that my proposal doesn't solve everything I'm raising here now. The radiogroup > label example is new to me. I think changing this to SHOULD will result in tools ignoring this. If we can find another solution, I think I'd prefer that. In thinking more about the radiogroup example, radiogroups, unlike most other required context roles, don't really need to have a parent-child relationship: It seems to me that the following shouldn't be valid ARIA: <div role="list"> <div role="article"> <div role="listitem"> But this probably should be: <div role="radiogroup"> <div role="article"> <div role="radio"> The other thing I realised as I was reading your reply is that "owned elements" doesn't just apply to an element's children, but to all its descendants. That's clearly incorrect too. All children of a list must be listitems, but the descendants of thost listitems don't have to be listitems too. That's completely different from radiogroups, where it really doesn't matter if the radiobutton is a child or some lower down descendant. I think radiogroups are completely different from lists, grids, etc. It might be better to just not give them a requirement. That way required owned element can be used for things that need that strict parent-child relationship, and we can keep that MUST in. |
@carmacleod @jnurthen any update on this? |
@carmacleod wrote:
In the call today, @smhigley pointed out that if we solve both 2 and 3, then required owned elements would be meainingless. No elements would be required per item 2 above. Any particular kind of element would be allowed per item 3. I agree with her observation. I am pretty certain that the origin of required owned elements is that the element that requires specific descendants is not complete or valid if it does not contain at least one of the required owned elements. I have always understood it that way. If an empty list is allowed, then it should not have any required owned elements. At the same time, required owned elements has never been restrictive. In other words, it does not mean the same thing as "allowed" or "permitted" elements. ARIA does not currently have a concept of permitted descendants except where explicitly stated in prose via normative author must requirements. I think this issue should be limited to clarifying that required owned elements means "at least one" of the required owned elements is required. If there are cases where we list required owned elements where in fact none are required, e.g., list, then we should fix that by removing the required owned elements from those roles, in a separate PR. If we want to add a specific "permitted" elements type of requirement to ARIA, that too should be a separate issue. |
I think it makes sense to wait on a final definition of Owned element first (see #748) and then we can work on refining the definition of Required owned elements. |
@mcking65 I definitely see your point about "permitted" vs "required". That's a fair distinction to make. Going through the list, I'm not too sure there are any required owned elements in that case. The ARIA 1.1 combobox pattern is the only one that comes to mind, but that too is no longer valid. Everything else seems like it can be empty. |
Discussed in WG call on 11/12/2020**JN:** this one we have a PR, is that correct? … this is dependant on a different one … #748, is that done? … no … so this is now dependent on something else, who wants to think about this one? … because these all need resolvingCM: is this all kind of rolled into what is a descendant MK: no this is different, this is about what does required owned elements mean JN: so does required own elements -- we really mean allowed owned elements MK: no we dont actually, so that is the question on the table. There are several scenarios that are different. There's this question of things in a tablist because we don't list button as a required owned element, is it actually an allwed element, or is illegal to put a button in a tablist CM: do we need another entry in the characteristics, so required means required, and we can add allowed? MK: I don't know, because right now in menu you can have group or menuitem, but you don't have to have both, you can have one or the other SH: I think required is difficult because for most things you can have an empty container JN: I think in most cases required means allowed, but maybe there are more things that should be added to that? MK: in most cases allowed sounds exclusionary JN: in most cases I've read required as exclusionary SH: currently although I see a use case some times for other elements, it breaks certain AT behavior if it's not exclusionary JN: so if that's not the intention, we should clarify MK: yeah we would break the empty container thing if we changed it to required JN: Matt, in your comment earlier:
JN: is that true that ARIA doesn't have a concept of perimtted descendants? because if that's not true maybe we should just drop required owned elements MK: yeah I wish I had dropped some examples in here. I think this is a place where we should do some analysis JN: actually so doesn't the required owned elements thing hit presentation as well? SH: only if you interpret it as children and not descendants MK: that would be great to have in a comment in the issue SH: an empty menu should be allowed for authors, and AT can treat it as not a menu MK: so if the browser were to handle that in the recovering from errors section, maybe we could leave that menu
JN: I have no problem with containers being empty, a screen reader should just ignore it IH: what should happen if the container gets focused JN: generally the containers shouldn't get focuseed unless someone has messed up anyway MK: yeah, they're all containery JN: a listbox with nothing in it is focusable, but is allowed in HTML MK: a lot of those are focusable because they support activedescendant MK: are empty grids and tables something to allow? Because currently they're not permitted JN: right now none of these things are allowed, which seems wrong SH: I think there's a solid use case, e.g. when users can remove rows and they remove all rows JN: or you can hide columns, and hide all columns MK: which disagrees with html, same with listbox JN: I don't know MK: I don't know, but I think I would like to know that JN: anyone want to investigate native html behavior for each of these things and work out what happens there? MK: there's only four: definition/associationlist, table, list, listbox IH: should I have a go at that? JN: of course! and you can hassle Scott, that's even better CM: so you're asking for two things? What does HTML say, and what does AT do? JN: yeah, I think we should work out whether HTML allows an empty table or row, then we should work out what actually happens in accessibility APIs MK: I said there were only four, but now that you bring that up, can you have an empty row, or table body? JN: yeah we should, but we should probably start with investigating just the top-level things. We don't need a complete analysis JD: I agree in spirit with "also see what ATs do" but ATs are often working around browser and author weirdness, so as an interim step we should look at what is exposed to us using accessibility inspectors, independent of what the screen reader is actually saying JN: yeah, I agree Joanie |
5.2.5 Required Owned Elements:
As a non-native English speaker, this first sentence doesn't make sense to me. It doesn't seem to say anything, rather it seems like an unfinished sentence. As though what it should have been is "Any element that will be owned by the element with this role MUST be one of the required owned elements", but the sentence got clipped.
Then in the second sentence it says "will own at least", even though that is followed by a paragraph explaining how there are cases where a list can be empty. Which strongly implies that something like this would be fine:
This "at least one" is especially confusing. Should this have been all owned elements SHOULD have a role from the required owned elements list?
The text was updated successfully, but these errors were encountered: