-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Popover invoker example shouldn't have aria-haspopup
#9153
Comments
that's true that the aria-expanded state is provided by the popovertarget attribute by default, but this example was provided as an instance where So this is not a bug/incorrect, but maybe this could be more clear in why this example uses the attribute but, for instance, the previous example which opens a popover of a list of sub-navigation links does not use aria-haspopup. |
Why can't the UA infer that from the relationship that already exists between the button and the popover? |
I'm not sure I understand the scope of your question? Is this just down to a simple misunderstanding that one thinks Or is this a question that requires a further explanation/understanding of what ARIA does / doesn't do in the context of HTML? |
It could be a misunderstanding. You said:
Which I understood as: This element should have However, due to the Since the reasons given for adding It felt to me like how you don't need to give an |
|
We're discussing this example where the role is on the same element as the |
My comment was more generally directed at OP which states:
Inferring seems sensible to me but I also felt it necessary to call out that the association isn’t always straightforward. |
To clarify, this issue is about this specific example in the HTML spec. I don't think anyone's suggesting that particular aria attributes are redundant in all imaginable cases. |
yes, a misunderstanding.
maybe a better word choice for me would have been "controls". The open/close state is already handled by the button/popover association - so this was not really the point of the attribute. Rather, this is some rather annoying legacy baggage to ARIA where a "menu button" can only be defined by use of
In this example, sure. But not per @keithamus's reasonable alternate example. Nor would this association be possible if the popover was dynamically (in full or partially) created only when needed.
Understand the comparison you're trying to make, but it's a bit off per what you were initially asking about why couldn't the UA just know to make the association based on the
and circling back to how i started this response, this is a misunderstanding. this is not a redundancy. |
the problem i see here is that this is a correct markup example for how someone would need to create a popover |
Can we stick to the example in question? I'm finding it hard to figure out which statements are referring to the example linked in the OP, and which statements related to other imagined examples. In the specific example, could the UA infer that the button 'controls'/'opens'/has-a-popup of type 'menu', given:
|
outside of that one paragraph, everything i've mentioned is in context of the example in question. so, yes. i did stick to the example in question. |
If you can help me understand, I can help edit the example and surrounding text so others don't have the same misunderstanding. |
i'd be happy to, but maybe this would be something we need to talk out? i've already answered what you asked, so i'm not quite sure where the disconnect remains? |
Happy to jump on a call or something, but it'd be helpful to get a clear answer to the second part of #9153 (comment):
And if the answer is 'no', what ambiguity exists that needs clarified by aria? |
the answer is no. and per my previous response
this is directly related to this issue #9110, and why |
I don't think I'm suggesting any UA behaviour change here, other than accessibility tree details, which ARIA absolutely does influence. |
I don't see the relation there. That's suggesting a change to click semantics. I'm only suggesting the UA exposes information to the a11y tree based on content. |
you may not realize it, but you actually would be suggesting behavioral change. a menubutton is treated differently than a standard button to AT. And if the UA automatically makes that change for this specific instance, it likely should continue down the cascade of additional functional changes that would be expected for a menu/menu button pattern. And if you do that, well then why not start making other changes automatically, e.g., the above linked issue? but then, you may also start introducing changes that the author doesn't actually want. it's messy. |
So:
Am I right that the 'violation' you see here is that the UA would infer I think this is different from #9110 because the behaviour I'm suggesting here remains in AT space. It isn't changing non-AT behaviour. My desire here is for pages to be as accessible as possible without developers having to re-state what is already stated in the DOM. If the author has told the UA that a thing is a button (via |
the reason they're related is because while what you are suggesting is just changing the semantics in the AT space, it doesn't get into the expectation of what other functional changes would be associated with those changes. Again, happy to jump on a call to discuss this further, but I think we're going to keep going in circles otherwise. |
I feel like I'm struggling to get straight answers in one or two places here, which may be why it feels like a circle to you. I'd like to try one more time here, as it's documented for others. For example:
Am I right there? I'd like a direct answer to this. I was seeking clarity, and you've suggested you know the answer here.
Can you detail those functional changes? I feel we're from different schools of communication here. The situation we have here is either an example that creates confusion through lack of data, or an implementation that could be improved. My aim is to discover which of those problems we have, and understand it to the degree where I can fix it. If you have that information, I'd love to hear it. If you don't feel you understand the problem enough to provide that information, it would be good to know that too, because I can stop bothering you and find someone with the relevant knowledge. |
i agree that we seem to have two different communication styles / expectations of what should be sufficient answers. I'm not at all trying to be dodgy with you in my responses, but it's apparent that you seem to think otherwise. anyway...
partially yes. i wouldn't say it's a violation, but it would be a change that would be highly reliant on the setup of the popover, which is why i know you keep wanting to have this scoped to just the example in the html spec, but the additional examples that Keith/I alluded to need to be considered as well. If the nuance of why this is needed is too much for devs to grock, then they sure as heck aren't going to understand why they'd need to do add the attribute sometimes but not others, based on their markup choices.
The primary functional change is that for a majority menu patterns focus automatically needs to move to the menu popup when invoked. And as I just briefly talked to Aaron Leventhal about this over the phone, he agreed that we would not want to change focus behavior based on ARIA semantics being changed. So, we're at an impasse of where the UA would be "sometimes" - per the above point - providing modified ARIA semantics for a situation the UA could infer, but not necessarily the modified behavior associated with that change in ARIA semantics. But let's say the decision was made to make that functional change in this one instance. Well, now what about the additional keyboard navigation behavior associated with going through the menuitems? Why wouldn't the UA do that automatically? It can snowball from there. For instance, would this decision then leak out to other HTML elements? e.g., if i were to do the following:
rhetorical: should that pattern not also automagically know that the summary should be exposed as a menubutton? There'd then also be additional and more complex popover patterns to take into account. E.g., <button popovertarget=f>...</button>
<div role=listbox popover id=f>
...
</div> There's a lot to unpack from what could automatically happen there, and it too would have more than just ARIA semantics that need to be conveyed, but a decision tree of varying keyboard/focus behaviors to go along with it, which would then also need to be contingent on the children of that listbox and if the author strayed from the currently allowed children of that element - e.g., if they included other non-option elements that would then require further UA modifications or potential repairs. to be clear (i hope), these are all conversations that could be had. The relationship between ARIA and HTML could be revisited and rediscussed. But, we are also trying to keep this limited to just the example mentioned in the HTML spec. I obviously can't effectively do that when what is being suggested goes beyond that scope. edit:
I missed this from a previous message, but as an FYI, if popover attributes were not being used, the markup a developer would have to write for this now would be:
so to your point, if a developer had to re-declare |
Is there existing precedent for an attribute which only changes data in the accessibility tree (ie role/aria-*) to establish a relationship in the DOM tree? Unless I’m mistaken The Part of me wonders if this is an opportunity to revive |
i'm afraid the ship may have sailed on |
I'm not sure about this. Developers seem to know that
I can't repeat this enough: I'm not suggesting ARIA attributes should change things like focus. Popovers already have focus behaviours, and the example we're talking about already makes use of them.
I wouldn't be against a browser feature that provides this functionality, but again, I don't think it should be inferred from ARIA.
Would that be a bad thing? As in, would it be worse than how browsers currently interpret that DOM? If I understand what you're saying, I get it, there are lots of interactions developers need to build to make certain components accessible, and it'd be great if HTML could provide them, and I agree that ARIA shouldn't provide them. I hope OpenUI continues to push on this. In this case I'm simply suggesting that an ARIA attribute shouldn't be required if the need for that ARIA attribute can be inferred from other semantics, just as I feel this wouldn't be getting push-back if it didn't cross this conceptual ARIA barrier (that's fun to say), which is why we should be questioning whether that barrier is valid in this case, given the result exists purely in AT space. |
I mean…
And I'm not sure the 'constraint' makes sense. |
I know you keep saying that, but that's the problem, it's at odds with your proposal. If the UA will automatically change an element's role / a11y properties to something that should change focus / should come with implicit functionality, but it doesn't provide that functionality, then that'd be broken.
do i have some code to show you sometime :) |
I don't feel it's at odds. Popovers already have focus behaviours. I guess our disagreement here is: I feel that an incremental improvement that removes redundancy is valuable, whereas you insist on a kitchen sink approach? |
you think i'm insisting that? hmm. |
I thought that was the point you were making?
It feels like you're saying if we remove redundancy in this AT space, we'd simply have to make behavioural changes too. But I'm not seeing good evidence for that. You bring up focus, but popover already has focus behaviours, so that wouldn't need to be added. The keyboard interaction for menu items would still need to be added by the developer, and I hope this is something that OpenUI or some other group makes much easier than it is now. But I don't agree that it would need to be done along with this particular removal of redundancy that stays within AT space. |
so Jake and I just hashed out a lot of this via a phone call. sorry not sorry we took this offline, but we needed to do this to better understand where each of us were coming from. We do now agree there is a level of redundancy that an author would need to do not only markup a popover as a menu, but also indicate this via the button element with aria-haspopup. We did also come to an understanding that this is unfortunately a bit of redundancy that comes with creating custom components using ARIA. Where as had there been an actual HTML component that provided the necessary semantics and behaviors of a role=menu, then there would not have been an expectation for an author to need to set aria-haspopup on the button. Because, the UA would have been able to make this association, and thus update the button's role, but the UA could then also deliver on the functionality that it would have been promising to AT users, by exposing that role. With that said, we saw two pathways forward here:
@jakearchibald please feel free to add in anything that I may have forgotten or glossed over. thanks |
That all seems right to me. I think which option is best comes down to how useful For option 1, I think that we should acknowledge that the redundancy suuuuucks, and that hopefully, in future, it could be replaced by a proper HTML element that has all the behaviours and semantics. |
Why isn't a Until we have custom element buttons you need to use |
cc @whatwg/a11y |
The incidentally, just looking at https://html.spec.whatwg.org/multipage/popover.html#the-popover-attribute:~:text=button%20popovertarget%3Dmenu%20aria%2Dhaspopup%3Dmenu can I suggest that the |
Reading this issue, I understand the presence of I do worry that it may sit in the way of developer's easily understanding what is going on. Especially given that ARIA is outside of HTML, and the string “haspopup” includes the word “popup”, while you're trying to define an attribute named “popover”. Imho this adds mental overhead for web developers, which could lead directly to wrong usage and, with that, potentially bad / inaccessible end-user experience.
Yes. As I understand it, it can open elements with a number of roles (including I am probably misunderstanding something, but I wonder… if we're expecting developers to use roles to indicate the semantics of their popover, couldn't that value be used to automatically set a For example: // The popover is a menu, maybe the browser can safely automatically add aria-haspopup=menu?
<button popovertarget="myMenu">Open menu</button>
<div popover role="menu" id="myMenu" >…</div>
// The popover is a listbox, maybe the browser can safely automatically add aria-haspopup=listbox?
<button popovertarget="myListbox">Open listbox</button>
<div popover role="listbox" id="myListbox" >…</div>
// The popover is a dialog, maybe the browser can safely automatically add aria-haspopup=dialog?
<button popovertarget="myDialog">Open dialog</button>
<dialog popover id="myDialog" >…</dialog>
// The popover has no semantics, maybe the browser adds no aria-haspopup
<button popovertarget="myPopover">Open popover</button>
<div id="myPopover">…</div> (Was thinking it could default to Or would the above example be very unhelpful given there are, in addition to this
Either way, one thing this shows is that a lot depends on web developers making the right choice for their thing between a lot of different but slightly similar semantics. I would love such examples to exist somewhere (maybe even in the spec, and maybe with concrete examples of what goes in the actual popover, so that web developers are more likely to choose the most appropriate). |
As mentioned in my last comment, I’ll update the example. I’ve been on vacation so I haven’t gotten to it yet. I will next week. |
Sorry, didn't mean to derail that course of action with a whole new suggestion, @scottaohara. When you get to it, I would happily volunteer to help review the example if an extra pair of eyes is useful. |
Remove the aria-haspopup attribute in the popover example. It is confusing and explaining it would distract too much from the example. Instead allude to ARIA having requirements related to the construction of a menu widget. Closes #9153.
It was pointed out (@jakearchibald @aleventhal) that in this example:
https://html.spec.whatwg.org/multipage/popover.html#the-popover-attribute:~:text=button%20popovertarget%3Dmenu%20aria%2Dhaspopup%3Dmenu
the button with
popovertarget
also hasaria-haspopup
, but that's not right. Elements withpopovertarget
should automatically getaria-expanded
via the UA, but shouldn't need or want to manually addaria-haspopup
. Generally, using declarative popover triggering should be accessible by default, so no manual ARIA should be required in the base case. If folks agree, we should removearia-haspopup
from that example.The text was updated successfully, but these errors were encountered: