This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26326 - Why fully exit fullscreen when an element is removed?
Summary: Why fully exit fullscreen when an element is removed?
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Fullscreen (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-14 09:27 UTC by Philip Jägenstedt
Modified: 2014-07-28 13:18 UTC (History)
5 users (show)

See Also:


Attachments

Description Philip Jägenstedt 2014-07-14 09:27:35 UTC
http://fullscreen.spec.whatwg.org/#model

[[
If an element at the top of a fullscreen element stack is removed from a document, fully exit fullscreen.
]]

AFAICT, this is the only way that "fully exit fullscreen" is exposed to scripts. This allows an iframe embedded in a presentation to exit fullscreen for the presentation itself, which seems bad even if rather harmless.

Why not just exit fullscreen on the document from which the element was removed?
Comment 1 Anne 2014-07-14 14:35:48 UTC
I think the user experience was found too confusing in the alternative scenario.
Comment 2 Anne 2014-07-14 14:37:03 UTC
I guess an alternative model would be to switch the fullscreen element from the one that is removed to its parent or some such. Might still be confusing.
Comment 3 Philip Jägenstedt 2014-07-14 15:12:29 UTC
(In reply to Anne from comment #2)
> I guess an alternative model would be to switch the fullscreen element from
> the one that is removed to its parent or some such. Might still be confusing.

Wouldn't calling exitFullscreen() do just that? It deals with the case where an element other than the top one has been removed, after all.
Comment 4 Philip Jägenstedt 2014-07-15 07:10:00 UTC
Oh, I missed this bit: "HTML invokes the fully exit fullscreen algorithm for navigation." Scripts should be able to trigger that as well.

I filed this bug because it looked like an oversight, but if it's already been discussed I'm OK with WONTFIXing.
Comment 5 Chris Pearce 2014-07-15 10:21:26 UTC
(In reply to Philip Jägenstedt from comment #0)
> AFAICT, this is the only way that "fully exit fullscreen" is exposed to
> scripts. 

FWIW, our fullscreen implementation allows script to exit fullscreen by calling document.exitFullscreen(). The justifcation being that script can exit fullscreen by removing the fullscreen element from the document anyway.
Comment 6 Philip Jägenstedt 2014-07-15 12:22:51 UTC
(In reply to Chris Pearce from comment #5)
> (In reply to Philip Jägenstedt from comment #0)
> > AFAICT, this is the only way that "fully exit fullscreen" is exposed to
> > scripts. 
> 
> FWIW, our fullscreen implementation allows script to exit fullscreen by
> calling document.exitFullscreen(). The justifcation being that script can
> exit fullscreen by removing the fullscreen element from the document anyway.

AFAICT, Document.mozCancelFullScreen() is the only API you have exposed and it seems to "exit fullscreen", not "fully exit fullscreen":
https://github.com/mozilla/gecko-dev/blob/355c7ec07cbe527decbb82d7045f6a39cafdb50c/content/base/src/nsDocument.cpp#L10374
Comment 7 Anne 2014-07-28 08:58:22 UTC
Chris, roc, what would be best here? Should removing the element do fully exit fullscreen or just exitFullscreen() on its node document? I don't really care either way, as long as we all agree.
Comment 8 Robert O'Callahan (Mozilla) 2014-07-28 09:09:59 UTC
I don't care either.
Comment 9 Chris Pearce 2014-07-28 09:20:17 UTC
(In reply to Philip Jägenstedt from comment #6)
> AFAICT, Document.mozCancelFullScreen() is the only API you have exposed and
> it seems to "exit fullscreen", not "fully exit fullscreen"

Correct. But script can still "fully exit fullscreen" by removing the fullscreen element from the document.

(In reply to Anne from comment #7)
> Chris, roc, what would be best here? Should removing the element do fully
> exit fullscreen or just exitFullscreen() on its node document? I don't
> really care either way, as long as we all agree.

I don't feel particularly strongly.

The only argument I can think of is I could imagine a kiosk or some-such running in fullscreen mode with child iframes would not want script in the child iframes to be able to break the top-level browser out of fullscreen mode. So perhaps removing the fullscreen element should just exit fullscreen in the document where the removed element resided.