-
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] Consider to dispatch show event as the first step of showPopup #579
Comments
Thanks for the comment. In a practical sense, I don't think it would matter if we reversed the steps there, because only step 3 does any rendering. It would be an observable change, of course, but what I'm saying is that I'd be open to that change. We've discussed the cancelability of the |
It is partially an implementation detail why I'd prefer to fire event first and only after it change styling. There are cases where JS may spin event loop in Gecko, and I'd rather not change style right before that. But also, based on the experience with popupshowing, I think making show cancelable is quite reasonable. |
Thanks for the cancelable use case examples. They seem reasonable. And changing @smaug---- would you agree it's ok to keep |
(XUL popuphiding is cancelable, but I couldn't find any case where the event is actually cancelled in FF code.) I'm ok leaving hide as non-cancelable. I think it has fewer use cases and perhaps, if needed, it can be changed later. |
Per [1], there's a desire from Mozilla to move the show event earlier in the process, and make it cancelable. I see no issues with doing that, so pending a discussion (at [1]), I'm going to make this change. [1] openui/open-ui#579 Bug: 1307772 Change-Id: I87fcec84146f99434bb88d2af12941a2c9156586
Good point that it can be changed later. Ok, thanks. For reference, I implemented (in Chromium) the change to "show", and didn't find any issues. I also implemented the change to "hide", but there is some trickiness to the ordering when you have a stack of pop-ups. So yes it'd be nice to tackle this later, if the use case arises. |
Per [1], there's a desire from Mozilla to move the show event earlier in the process, and make it cancelable. I see no issues with doing that, so pending a discussion (at [1]), I'm going to make this change. [1] openui/open-ui#579 Bug: 1307772 Change-Id: I87fcec84146f99434bb88d2af12941a2c9156586 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3826329 Reviewed-by: Joey Arhar <jarhar@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1035213}
Per [1], there's a desire from Mozilla to move the show event earlier in the process, and make it cancelable. I see no issues with doing that, so pending a discussion (at [1]), I'm going to make this change. [1] openui/open-ui#579 Bug: 1307772 Change-Id: I87fcec84146f99434bb88d2af12941a2c9156586 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3826329 Reviewed-by: Joey Arhar <jarhar@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1035213}
Per [1], there's a desire from Mozilla to move the show event earlier in the process, and make it cancelable. I see no issues with doing that, so pending a discussion (at [1]), I'm going to make this change. [1] openui/open-ui#579 Bug: 1307772 Change-Id: I87fcec84146f99434bb88d2af12941a2c9156586 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3826329 Reviewed-by: Joey Arhar <jarhar@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1035213}
The Open UI Community Group just discussed
The full IRC log of that discussion<masonf> Topic: [popup] Consider to dispatch show event as the first step of showPopup<masonf> github: https://github.com//issues/579 <bkardell_> masonf: I think this is a short one. <bkardell_> masonf: this was an issue raised around show/hide event and whether they are cancellable - the main request was first to move the show earlier - it didn't make any diff in the chromium implementation so I did it <bkardell_> masonf: the second was about making it cancellable, I wanted to talk about it <bkardell_> masonf: the other was about whether hide should be cancellable - we decided previously that this is a foot gun and should _not_ do that - it sort of undoes all the goodness here <masonf> q? <bkardell_> masonf: if you want the things that would enable, you can use popup = manual --- I think we could make show cancellable, but not hide <bkardell_> masonf: thoughts? <masonf> q? <bkardell_> {awkward silence} <masonf> Proposed resolution: Make the "show" event cancelable and make it the first step of `showPopUp()`, but leave the "hide" event non-cancelable. <bkardell_> seems reasonable to me <emilio> +1 <bkardell_> scotto_: I don't have strong opinions, seems gine <bkardell_> s/gine/fine <bkardell_> dbaron: are there cases where you want _most_ of the behaviour but somehow still want to cancel hide? <bkardell_> masonf: it's a complex series of things, and it seems very difficult to unwind all of the sequence of behaviours - stacks of popups - and make it possible to do that <bkardell_> masonf: if you have nested popups, and you cancel, what happens? it gets very very tricky even with 2 <bkardell_> dbaron: yeah, ok <masonf> q? <bkardell_> masonf: any objections? <bkardell_> masonf: resolved <masonf> RESOLVED: Make the "show" event cancelable and make it the first step of `showPopUp()`, but leave the "hide" event non-cancelable. |
… make it cancelable, a=testonly Automatic update from web-platform-tests Move the pop-up "show" event earlier and make it cancelable Per [1], there's a desire from Mozilla to move the show event earlier in the process, and make it cancelable. I see no issues with doing that, so pending a discussion (at [1]), I'm going to make this change. [1] openui/open-ui#579 Bug: 1307772 Change-Id: I87fcec84146f99434bb88d2af12941a2c9156586 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3826329 Reviewed-by: Joey Arhar <jarhar@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1035213} -- wpt-commits: 6929d9ab93b16ea002b2812b23f3872a36f9bb8f wpt-pr: 35460
Per [1], there's a desire from Mozilla to move the show event earlier in the process, and make it cancelable. I see no issues with doing that, so pending a discussion (at [1]), I'm going to make this change. [1] openui/open-ui#579 Bug: 1307772 Change-Id: I87fcec84146f99434bb88d2af12941a2c9156586 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3826329 Reviewed-by: Joey Arhar <jarhar@chromium.org> Auto-Submit: Mason Freed <masonf@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1035213} NOKEYCHECK=True GitOrigin-RevId: 2343d80475c01f868b592640435e1c8dfd03498d
Currently there is
I'd expect show event to be cancelable (though such behavior could be added later too, assuming firing show is the first step).
Is there any reason for the current behavior?
@emilio
The text was updated successfully, but these errors were encountered: