[Bug 28459] New: Algorithm of exitFullscreen() doesn't work correctly when there are nested fullscreen element

https://www.w3.org/Bugs/Public/show_bug.cgi?id=28459

            Bug ID: 28459
           Summary: Algorithm of exitFullscreen() doesn't work correctly
                    when there are nested fullscreen element
           Product: WebAppsWG
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Fullscreen
          Assignee: annevk@annevk.nl
          Reporter: quanxunzhen@gmail.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Friday, 10 April 2015 04:45:39 UTC