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

Deal with two fullscreen elements in top layer and one element being removed #133

Open
dtapuska opened this issue Aug 22, 2018 · 1 comment

Comments

@dtapuska
Copy link
Contributor

With changes in #128 when you have two fullscreen elements in the top layer, and you remove one of them, you would end up making the browser window still in fullscreen, but the document has exited the fullscreen state.

@foolip
Copy link
Member

foolip commented Feb 11, 2025

This came up again in #243 and I've written some more tests in web-platform-tests/wpt#50630.

The relevant parts of the spec are step 3.1 and 3.2 of the "removing steps", and step 7.2 of "exit fullscreen".

These are the 4 situations now covered by tests and what I think the spec requires (after #243):

  • remove-first.html: Parent and child elements in fullscreen and the parent is removed. The removing steps visit the parent first, but since it's not the fullscreen element, it just unfullscreens that node. Then it visits the child which is the fullscreen element, and invokes exit fullscreen. There, step 7.2 is reached which unfullscreens that node too. Actually exiting and events follow async.
  • remove-last.html: Parent and child elements in fullscreen and the child is removed. Since the child is the fullscreen element, the removing steps invoke exit fullscreen. There, step 7.2 is reached which unfullscreens that node too. Immediately after removal, the parent is the fullscreen element. Then we exit fullscreen async which eventually clears all state.
  • remove-first-sibling.html: Two siblings in fullscreen and the first is removed. This should only unfullscreen that element and not exit fullscreen or fire any events.
  • remove-last-sibling.html: Two siblings in fullscreen and the second is removed. The second element is the fullscreen element, and this is much like the remove-last.html case.

AFAICT we don't get any dangling state, but the behavior is a bit curious. AFAICT there isn't any reason we have to exit fullscreen if there are other fullscreen elements still in top layer. The special case of the topmost such element seems unnecessary, but probably also harmless.

cc @nt1m

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

2 participants