fullscreen
fullscreen copied to clipboard
Exit fullscreen on document with multiple subdocument in fullscreen
Assuming we have tree like:
body (document)
|
+- iframe #fa
| |
| +- div #a
|
+- iframe #fb
|
+- div #b
If we do:
a.requestFullscreen()b.requestFullscreen()document.exitFullscreen()
According to the current spec, it seems the result is:
- the content documents of both iframes exit fullscreen
- the current fullscreen element of the document becomes iframe #fa
This doesn't seem to be correct. I think only the content document of #fb should exit fullscreen.
I suggest moving the unfullscreen descendant document steps into unfullscreen an element.
It looks like because "collecting documents to unfullscreen" returns an empty set, we will fully exit fullscreen in step 9.2. Is that where the problem is?
No. In that case, resize is false, so it won't fully exit fullscreen in that step.
Oh, right you are. So at step 9.4, resize will be false and exitDocs will consist of only doc itself. I suppose things start to go wrong at step 9.5, where all descendant documents are collected instead of just the ones in exitDocs.
Both unfullscreen an element and unfullscreen a document are low-level operations, so if there's a fix for this that would be contained inside the definition of exit fullscreen, that would be nice.
The issue is that, we may also need that in the removing steps. If we replace step 3 with body.removeChild(fa), should the inner document exit fullscreen? Maybe that could happen via some other mechanism, though.
Yeah, it does look like the removing steps can end up simply calling unfullscreen node for iframes whose content document has a fullscreen element. That looks like an unrelated bug, though, probably those steps worked when fullscreen element stack had to be in tree order?
Yeah, it worked before, because iframe if any may only be the top in the fullscreen element stack.
I think those steps should be moved to unfullscreen node because descendent document is part of iframe elements, and thus whenever you unfullscreen the element, its inner document should always get unfullscreened as well, no?
Yeah, that has a certain appeal, as long as making this recursive doesn't make it harder to fire all of the events at the end of exit fullscreen.
Ahh... you're right... Then they are two different issues...