-
Notifications
You must be signed in to change notification settings - Fork 191
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
[popup] Note that popup=async + JavaScript allows custom behavior #495
Comments
@mfreed7 is the sole purpose of this to be a reminder for you to add a positive note to the spec regarding this? |
I think this warrants some discussion, actually. I was discussing this with @una today, and we came to the conclusion that
There are some differences:
The above begs the question: do we need both? Are these two things (non-modal dialog and Side note: I really like the suggestion to rename |
@mfreed7 it seems like the underlying question here is, "Are all instances of |
agreed. we are verging on discussing what toasts-like notifications should be marked up as without discussing them directly. are hey non-modal dialogs? are they non-modal dialogs which have also been marked as popups to get them in the top layer? are they something else entirely? Note: there are also a variety of open questions / spec-gaps for non-modal dialog which may further diverge these two concepts. so what a non-modal dialog behaves like now is not necessarily how it should be behaving |
After a discussion with @aleventhal, and based on the comments above, it seems increasingly clear that there are really only two use cases currently being discussed for
Since the "everything else" use case is rather nebulous, it becomes tough to design things like accessibility. We were wondering if it might make sense to rename Given our previous IDL resolution, the available values for the |
I could see |
I was mostly being silly, please ignore! |
Noted! I'll stand by the potential implication of having a name that also represents an intuitive role here. I know we were hesitant to tie popup to role so I think it's worth consideration. FWIW, I'm not a fan of names like "toast" or "snackbar" but in this case I'd take the first over the last myself :) |
i think the thing we need to keep in mind if we go this direction, we take into account it was previously decided that there could be multiple of these on a page at once, on page load even. if they all have the potential to be individual live region elements, that could create A LOT of dynamic announcements. Live regions competing with each other (when multiple are declared and fired at the same time on a web page) resulting in having their announcements overwritten by each other, or accidentally cancelled out by users is unfortunately common. As I mentioned in the other doc we were working on (so i'm not going to repeat myself here for now), i'm not opposed to going this way with the attribute value. I would just want to tread carefully. re: the potential new attribute name. i'd submit we should have another naming discussion on that (everyone's favorite thing to do, i realize). A lot of things have changed since that resolution. However, if we codify the image of toast that domenic posted into an emoji that could be used as the attribute's value... then i rescind that statement, and we absolutely should just make the value 'toast emoji' (of which i could not easily find one in my 3 minutes of looking)
|
No matter how hard we try, this may be something the author needs to at least think about. How about this: we support both popup=async and popup=notification.
There is no perfect solution, but if we can be 80% right that would be great. |
i like that @aleventhal |
I wonder if it's preferable to have an element, like |
i absolutely think that's the preferable end goal. if something like a |
I feel like this is veering a bit away from the spirit of From what I can tell, we are building Like other such APIs, it needs to be combined with CSS and ARIA to give good presentation and accessibility. It is a low-level API, in other words. One day we should build If we're going to make this a high-level API, then we should go back to an element, indeed! Such an element should have default accessibility semantics, default styling, and all that fun stuff. But I thought we decided to punt on that and just build the top layer primitive, when we decided to move from So to circle back around to naming (#532), that's why I think |
@domenic you make a lot of good points. I'm not sure it's cut and dried here tho. We are already including default behavior for popup=hint, because it seems like a very solid signal. I think popup=async is also a signal, that there is something happening a screen reader user probably needs to know about. We don't know how noisy of a signal it will be. |
What do you mean by default "behavior"? |
A hint popup will automatically show up on hover, and I believe it should automatically show up on focus. |
Oh, that seems really unfortunate. Now I don't know what the I would urge the group to reconsider, perhaps by moving hint popups to their own element. |
@domenic would you prefer that we wouldn't have gleaned a11y signals from the hint tooltip? Or you understand the decision, and it just makes you question that it's an attribute. |
Either of those path sounds good. Either leave |
@mfreed7 what's your take? |
@domenic @aleventhal I would propose we go down the middle here. As I do agree with not using the attribute to essentially implement a new element without actually implementing the new element (e.g., toast or tooltip). But there are some attributes in HTML now that do modify the semantics/a11y properties of an element. |
There are two things that make this different:
So I guess a third path would be to assign semantics and default ARIA roles and a11y mappings to all values of |
I think your points are clear and we should be able to work in the confines of those, and if we find instances where we are veering out, then we have identified features of the element that we should be creating. |
I'm unclear about what the proposal is going forward. |
I double-checked https://w3c.github.io/html-aam/. As defined there, there are no global attributes that impact role computation. (Including, e.g.,
So, introducing a global attribute with role impacts would be unprecedented, at least per specs. This is important because global attributes need their accessibility impacts spelled out for every element in the spec, e.g. we need to say what I don't think there's any good answer to that question. If we're saying A proposal on the table is that
Right now we have a pretty clear message for how to indicate accessibility role: use an appropriate element if you can, otherwise use That is why I think that, when introducing new HTML elements and attributes, we should use elements for things that impact role computation. We should not use global attributes to impact role computation. Given this, I suggest the following concrete proposal:
Then there is never a confusion. If you are using |
It's true that hidden and contenteditable don't impact roles, but they do have a pretty significant semantic impact, albeit not the role. Hidden removes those elements from the a11y tree altogether. Contenteditable significantly changes the semantics in that now this thing is an editor.
That makes sense to me. To clarify, are you proposing that popup="hint" would no longer exist? That is, there wouldn't be an equivalent way of doing |
While In the case that the popup is a semantically meaningful element, this is not a problem. The base role will already help the user experience the popup as a separate object. However, it is a problem if the popup is a generic element. What will differentiate this object from any other generic objects for the user? At the moment, the only technique that I know of is to change the role, e.g. to group or region. However, I'd be fine with committing to working with the a11y community and AT vendors on a new technique, such as a new property in the AX tree. It would describe that the contents of a subtree are grouped together in a meaningful way. I'm actually excited by it because it lines up with another problem I had on the back burner, which is that users sometimes accidentally "fall out of" the container they are working in, getting lost. So perhaps this is another example of a discussion that actually leads to other improvements. It will take time to develop a new technique, because of the slow/paid AT upgrade cycles. So, I propose we keep the role change on a generic popup (e.g. |
Note that However, I think it'd be possible to have an attribute value that doesn't imply the tooltip role, and does get the
For the "???", maybe "hint" is fine. It'd be ideal to have a name that was very behavior-focused, and didn't have any indications of what type of control it should be used for. But I can't think of any good ones off the top of my head. Maybe "weak"?
I think the role change is a footgun, as I pointed out above. I'm not very comfortable introducing a new attribute into the HTML Standard if the intent of the HTML-AAM authors is to immediately use it to cause role computation to become fragile in that way, for an unknown amount of time until new technology appears. But maybe as an interim technique, not encoded in any specs but just something Chromium is experimenting with, it's a reasonable tradeoff. |
Proposed plan for the
|
Agenda+ to hopefully resolve on the comment above. I've slightly re-purposed #532 to bikeshed a new name for |
I'm not sure minutes are going to get posted, but just in case they don't, here is a copy: https://www.w3.org/2022/06/23-openui-minutes.html#t02
Based on that resolution, I'm going to close this issue. Hopefully the real minutes get posted soon. |
The Open UI Community Group just discussed
The full IRC log of that discussion<gregwhitworth> Topic: [popup] Note that popup=async + JavaScript allows custom behavior<gregwhitworth> github: https://github.com//issues/495 <andrico1234> masonf: take it as an action to spin up issue about default styles <andrico1234> masonf: we've talked about this issue. does popup attributes affect semantics. popup attribute only describes behaviour. all of it is behaviour, none of it is semantics. side thing, popup async to popup=manual <andrico1234> masonf: aligns more with popup=auto, it feels parallel and easier to understand <andrico1234> masonf: a side issue with renaming popup=hint, but a separate issue. last thing is not part of resolution. phase 1 is what we've talked about with 3 values. phase 2 is to define actual elements for some of these usecases with these semantics, like tooltips and notification <andrico1234> masonf: use these values, but semantic elements with base styles <masonf> Proposed resolution: The popup attribute in HTML will describe only behavior (what it does, such as top layer, dismiss behavior and so on) and not semantics (what it should mean to other tools such as accessibility). Also rename popup=async to popup=manual. <gregwhitworth> q? <dandclark> q+ to agree <gregwhitworth> ack dandclark <Zakim> dandclark, you wanted to agree <gregwhitworth> +1 to the proposal, I don't need to rehash my opinion <andrico1234> dandclark: i agree with these points. we had long conversations about defining semantics for popups as they're used for so many things. feels right to not add semantic baggage. also manual seems reasonable <una> q? <JonathanNeal> q+ <gregwhitworth> ack JonathanNeal <una> q+ <andrico1234> JonathanNeal: i just want to clarify, does that mean things like role, and aria attributes? <andrico1234> masonf: yes that's correct. you apply attribute to element, that element comes with its own role and how its calculate. it doesn't change <gregwhitworth> ack una <gregwhitworth> q+ vicgutt <gregwhitworth> q+ <masonf> una, you have a substantial echo on your audio <una> +1 the resolution, popup is at risk for a11y concerns, this resolves the concerns and still provides the needed functionality <una> we can provide demos for common usecases <una> that are accessible <gregwhitworth> ack vicgutt <andrico1234> vicgutt: wrt to a11y, the definition of the element we add attribute to. there would be a dedicated element for these popups? is that correct? and those elements would have the semantics defined <una> but i'd also want the UA to accessibly focus/apply semantics on the element when popup is open <andrico1234> masonf: yes, but that would be phase 2 <una> Would that mean that folks would still need to use JS for accessible elements? <andrico1234> vicgutt: it would be beneficial to have that <andrico1234> masonf: it's phase 2, but once we have the mechanics, then defining an element becomes a lot easier <JonathanNeal> Oo, thank you for that great question, vicgutt. Now I feel I can +1 this. <andrico1234> gregwhitworth: semantics for roles, as it relates to aria-haspopup, will that be owned by popup, that would be in the controller code. if i have popup attribute. that anchor is no longer adding aria-haspopup by default. the new element will add that <una> +1 to make sure popup still provides a11y semantics for popup focus <una> (regardless of role) <andrico1234> masonf: we're not changing roles, attributes are a grey area. <andrico1234> masonf: the way ATs look at the tree and decides what to do is up to the a11y side of things, how it's interpreted. your question might fall on that side of the line. i'm unclear whether it would be ok for us to haspopup, but good question <JonathanNeal> Unless we have good element internals for ARIA, messing with just ARIA could still be messy. If I remove the popup attribute, would it also strip the ARIA attributes? Unless I overwrote them? <una> I have the same questions/concerns as Greg <chrishtr> q+ <andrico1234> gregwhitworth: selectmenu does this out of the box. does the popup attribute come bundled with it? they are accessibility ones and make attribute accessible by default. the a11y comes the minute we implement tooltip elements, we'll do that wiring. i like that personally <JonathanNeal> If only the ARIA attributes existed in CSS, this would be a lot easier. <andrico1234> gregwhitworth: the attribute isn't bringing semantic baggage <andrico1234> masonf: i agree, selectmenu has controller code builtin and wiring is done correctly. maybe we shouldn't be doing anything at all attribute wise <gregwhitworth> ack gregwhitworth <gregwhitworth> ack chrishtr <JonathanNeal> q+ <andrico1234> chrishtr: i thought the plan was that there would be not any implied attribute. popup attribute would be behavioural, and wouldn't say anyting about semantics, new elements would instead. and bring their own things like their own implied haspopup <andrico1234> chrishtr: in the meantime ATs can do their best, but devs should add their own aria attributes so ATs now what they're doing <andrico1234> in the meantime until phase 2 <andrico1234> chrishtr: what you said about unclear to devs about what's going on, i.e. some attributes imply other things. good the atribute is explicit about behaviour. its a layering of api surfaces, 1. it's speaking to make it easy to achieve larger goals without doing it all at once <andrico1234> chrishtr: 2. for compat, there will be additional types of popups that we've missed, other edge cases. other popup behaviour, they can use it how they want, then we can codify it in Open UI <masonf> RESOLVED: The popup attribute in HTML will describe only behavior (what it does, such as top layer, dismiss behavior and so on) and not semantics (what it should mean to other tools such as accessibility, including the role and aria-* attributes). Also rename popup=async to popup=manual. <gregwhitworth> ack JonathanNeal <masonf> SORRY, didn't mean to add RESOLVED there. <masonf> Proposed resolution: The popup attribute in HTML will describe only behavior (what it does, such as top layer, dismiss behavior and so on) and not semantics (what it should mean to other tools such as accessibility, including the role and aria-* attributes). Also rename popup=async to popup=manual. <andrico1234> JonathanNeal: i want to +1 this, and +1 not messing with attributes. could be hard to remember. if i put popup on something, and it implicitly adds an aria attribute, what happens when I remove it <andrico1234> JonathanNeal: would been alot easier to discuss if we brought AT apis to CSS <JonathanNeal> +1 <andrico1234> gregwhitworth: i like the move from async, super confusing for me <andrico1234> masonf: sorry fr accidentally resolving, but added an extra bit on the end <masonf> RESOLVED: The popup attribute in HTML will describe only behavior (what it does, such as top layer, dismiss behavior and so on) and not semantics (what it should mean to other tools such as accessibility, including the role and aria-* attributes). Also rename popup=async to popup=manual. <gregwhitworth> Zakim, end meeting <Zakim> As of this point the attendees have been gregwhitworth, JonathanNeal, dandclark, andrico, bkardell_, una, chrishtr, masonf, tantek <Zakim> RRSAgent, please draft minutes <RRSAgent> I have made the request to generate https://www.w3.org/2022/06/23-openui-minutes.html Zakim <Zakim> I am happy to have been of service, gregwhitworth; please remember to excuse RRSAgent. Goodbye <gregwhitworth> RRSAgent, please leave <RRSAgent> I see no action items |
Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1
Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1
Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1
Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1 Cq-Do-Not-Cancel-Tryjobs: true
Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1 Cq-Do-Not-Cancel-Tryjobs: true
Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1 Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3722345 Commit-Queue: Mason Freed <masonf@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Reviewed-by: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1017762}
Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1 Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3722345 Commit-Queue: Mason Freed <masonf@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Reviewed-by: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1017762}
Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1 Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3722345 Commit-Queue: Mason Freed <masonf@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Reviewed-by: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1017762}
…stonly Automatic update from web-platform-tests Rename popup=async to popup=manual Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1 Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3722345 Commit-Queue: Mason Freed <masonf@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Reviewed-by: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1017762} -- wpt-commits: 7b93c5f15d2d4df418f7dc1e61c3f82e24935833 wpt-pr: 34567
…stonly Automatic update from web-platform-tests Rename popup=async to popup=manual Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1 Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3722345 Commit-Queue: Mason Freed <masonf@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Reviewed-by: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1017762} -- wpt-commits: 7b93c5f15d2d4df418f7dc1e61c3f82e24935833 wpt-pr: 34567
Per the [1] resolution, we have decided to rename popup=async to popup=manual, since it is a) parallel to popup=auto, and b) easier to understand. [1] openui/open-ui#495 (comment) Bug: 1307772 Change-Id: I786f6332c2a7f9df4810aeedfd425e38579ea1b1 Cq-Do-Not-Cancel-Tryjobs: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3722345 Commit-Queue: Mason Freed <masonf@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Reviewed-by: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1017762} NOKEYCHECK=True GitOrigin-RevId: c302eb6c79c4d435f8a046ae130fa5873ec36ecc
This issue was reported by @domenic here, and is being moved to the OpenUI repo.
This was a nice bonus I discovered upon reflection, and comparing with the old popup proposal.
If a developer wants some sort of custom behavior, e.g., "close all other toasts that are of a similar application-specific type", or "no force-close but yes light dismiss", then they can accomplish it using
popup=async
plus some custom JavaScript code for theentertoplayer
handler.This is good! It counters any arguments that, by providing somewhat-opinionated classes of UI, we're doing something too magic that will make developers sad.
I think this is worth pointing out in https://github.com/mfreed7/popup#classes-of-ui---dismiss-behavior-and-interactions .
(Also it may feed into the bikeshed discussion, e.g.
popup=manual
might be a better name thanpopup=async
.)The text was updated successfully, but these errors were encountered: