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 28459 - Algorithm of exitFullscreen() doesn't work correctly when there are nested fullscreen element
Summary: Algorithm of exitFullscreen() doesn't work correctly when there are nested fu...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Fullscreen (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-10 04:45 UTC by Xidorn Quan
Modified: 2015-07-18 07:21 UTC (History)
3 users (show)

See Also:


Attachments

Description Xidorn Quan 2015-04-10 04:45:37 UTC
It seems to me that the algorithm fails even on very simple cases.

Given the following tree: div#a > div#b
and do the following steps:
1. call a.requestFullscreen()
2. call b.requestFullscreen()
3. call document.exitFullscreen()

The expected result is, #a, as well as the viewport, is still fullscreen. Is it correct?


However, it seems to me that the current spec will cause very strange result. When document.exitFullscreen() is called:

In step 4, the "collect ancestors" returns [document] to docs, and since |document| is the topLevelDoc, so in step 6, resize is set to true, which cause the viewport be restored to normal dimensions in step 8.

In step 9.1, the "collect ancestors" again returns [document] to docs, and finally in step 9.6, #b is removed from the fullscreen element stack of the document.

Finally, #a is still in fullscreen element stack, while the viewport is no longer fullscreen.


To fix this, I think we should add a step at the start of "collect ancestors": If fullscreen element stack of doc consists of more than one element, return an empty set.
Comment 1 Philip Jägenstedt 2015-07-15 12:53:54 UTC
Has this been resolved by the recent refactoring?
Comment 2 Xidorn Quan 2015-07-17 02:44:45 UTC
No, it hasn't. The algorithm still doesn't look correct to me.
Comment 3 Philip Jägenstedt 2015-07-17 07:26:09 UTC
Yeah, you're right. Either collect ancestors should include doc if that has more than a single element in the top layer stack, or the exit fullscreen algorithm needs to handle doc separate somehow.