Re: [whatwg/fullscreen] Introduce document.exitFullscreen({ fully: true })? (#70)

@foolip our use case is as of web developers, but in working with current implementation briefs for websites that perform as single-page web apps (often designed to be viewed in fullscreen mode throughout) we've had a lot of issues. Many of the other libraries and components that are included have no knowledge of each other and many complications have arisen.

Sometimes the other libraries haven't implemented the spec with consideration that other elements could also be fullscreen, and in those cases Issues and Pull Requests have and can be raised.

In other situations, Browsers haven't considered the spec implications. Currently, Edge doesn't trigger fullscreenchange on the ELEMENT first (just on document directly), and Safari fails to enter a nested element into fullscreen mode at all. Again, browser bugs have been filed.

Even mainstream reference material does not take nested fullscreen properly into account. For instance:-
https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API#Toggling_full-screen_mode
https://github.com/rafrex/fscreen#usage

As developers, we just need the knowledge of the fullscreen stack to make appropriate decisions when third-party libraries have no knowledge of each other.

As a minimum, I would simply propose a getter for document.fullscreenElements (plural) to return a read-only array of elements, and by extension document.fullscreenElements.length
Ideally, a "fully" method to simulate the ESC-key currently, either exitFullscreenFully() or exitFullscreen({ fully: true })

The other suggestions in my previous post would be useful, such as element.exitFullscreen, but I would strongly desire the minimum of exposure to read the fullscreen elements in advance without popping each in turn to try and make appropriate decisions.

-- 
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/issues/70#issuecomment-468246940

Received on Thursday, 28 February 2019 11:59:43 UTC