[whatwg/fullscreen] Check the fullscreen element in the animation frame task for exit (#66)

The change to fulfill instead of reject is a drive-by for consistency.

The problem in the animation frame task was that if there are two
exitFullscreen() calls for the same document in the same animation frame
task, and an ancestor document has more than one fullscreen element in
its top layer, then the first task could pop one of them, and the second
another, potentially exiting out of fullscreen entirely.

With this change, exitFullscreen() is still not idempotent as doc's top
layer may be emptied where just one call would not, but at least it
stops when obviously silly things are happening.
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/fullscreen/pull/66

-- Commit Summary --

  * Check the fullscreen element in the animation frame task for exit

-- File Changes --

    M fullscreen.bs (7)

-- Patch Links --

https://github.com/whatwg/fullscreen/pull/66.patch
https://github.com/whatwg/fullscreen/pull/66.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fullscreen/pull/66

Received on Wednesday, 14 December 2016 23:23:12 UTC