Skip to content
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

Unfullscreening unconditionally removes from top layer, ignoring other qualities #222

Open
tabatkins opened this issue Apr 3, 2023 · 5 comments

Comments

@tabatkins
Copy link
Contributor

https://fullscreen.spec.whatwg.org/commit-snapshots/a69e295f652ec2b524e8429ecbe7bad61a57be21/#model

To unfullscreen an element, unset element’s fullscreen flag and iframe fullscreen flag (if any), and remove it from its node document’s top layer.

This means, for example, if you open a modal dialog, then fullscreen it, then unfullscreen it, it will no longer be in the top layer despite, presumably, still being modal.

Am I missing something? Is a fullscreened element supposed to forget its modalness (and if so, is that actually happening in one of the algos, somewhere I'm missing)? Or do we need to get a little more complex with this?

Assuming we do, I assume it might be something like giving an element a set of "top-layer reasons", and when we clean up the top layer we only remove it when all of its reasons are gone. Fullscreen would just add/remove "fullscreened" from the, modal dialogs would add/remove a "modal" reason, etc.

@mfreed7
Copy link

mfreed7 commented Apr 14, 2023

This means, for example, if you open a modal dialog, then fullscreen it, then unfullscreen it, it will no longer be in the top layer despite, presumably, still being modal.

Fullscreen explicitly outlaws fullscreening any dialog: https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen

@tabatkins
Copy link
Contributor Author

Right, I missed that at the time, but the same problem occurs with popovers that are then fullscreened.

@mfreed7
Copy link

mfreed7 commented Apr 14, 2023

So we discussed other such "interactions" between things that can be in the top layer in multiple ways, here: whatwg/html#9045

The general conclusion/direction seems to be that these things should only be allowed to be in the top layer in one of the ways at a time. So a.showPopover(); a.requestFullscreen() should reject the fullscreen request because the element is already a showing popover. But a.showPopover();a.hidePopover();a.requestFullscreen() should be ok. I.e. both are allowed, just one at a time.

@josepharhar has a PR against fullscreen, I think, to do the above. Is that right?

@josepharhar
Copy link
Contributor

has a PR against fullscreen, I think, to do the above. Is that right?

Yes, this PR will hide all popovers when making any element fullscreen. So that means that when an open popover is fullscreened, it will have hidePopover called on it before making it fullscreen: #204

@mfreed7
Copy link

mfreed7 commented Apr 17, 2023

has a PR against fullscreen, I think, to do the above. Is that right?

Yes, this PR will hide all popovers when making any element fullscreen. So that means that when an open popover is fullscreened, it will have hidePopover called on it before making it fullscreen: #204

I suppose that makes sense also - to hide the popovers before going fullscreen. I suppose it's likely that will happen anyway, given that the user must click a button to make something fullscreen, and that'll likely light dismiss the entire popover stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants