[whatwg/fullscreen] Removing steps on fullscreen element leave a dangling fullscreen flag (Issue #217)

If you have a fullscreen element, then move it to a different parent, it triggers the removing steps which does at step 3:
1. If node is document’s [fullscreen element](https://fullscreen.spec.whatwg.org/#fullscreen-element), [exit fullscreen](https://fullscreen.spec.whatwg.org/#exit-fullscreen) document.
2. Otherwise...
3. If document’s [top layer](https://fullscreen.spec.whatwg.org/#top-layer) [contains](https://infra.spec.whatwg.org/#list-contain) node, [remove](https://infra.spec.whatwg.org/#list-remove) node from document’s [top layer](https://fullscreen.spec.whatwg.org/#top-layer).

But in the [exit fullscreen algorithm](https://fullscreen.spec.whatwg.org/#exit-fullscreen), the fullscreen flag is only removed at step 14.3. This is problematic, because that step runs in parallel, so step 3.3 of the removing steps which removes the fullscreen element from the top layer will run before.

That means we end up stopping the exit fullscreen at step 11, so we end up never removing the fullscreen flag, which is problematic if the removed element is re-appended in the document.

Chromium handles it specifically at step 7. of exit fullscreen, by invoking the "unfullscreen doc's fullscreen element" as a step 7.2.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fullscreen/issues/217

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fullscreen/issues/217@github.com>

Received on Tuesday, 28 February 2023 22:38:03 UTC