[whatwg] api for fullscreen()

Brian Campbell lambda at continuation.org
Mon Feb 1 13:41:20 PST 2010


On Jan 28, 2010, at 9:42 PM, Robert O'Callahan wrote:

> enterFullscreen always returns immediately. If fullscreen mode is currently supported and permitted, enterFullscreen dispatches a task that a) imposes the fullscreen style, b) fires the beginfullscreen event on the element and c) actually initiates fullscreen display of the element. The UA may asynchronously display confirmation UI and dispatch the task when the user has confirmed (or never).

I like this proposal overall. I'm looking forward to being able to display content full screen; this is one of the last features necessary to start moving the kind of content that I work on to the web.

I'm a bit concerned about when the fullscreen events and styles apply, though. If the page can tell whether or not the user has actually allowed it to enter fullscreen mode, it can refuse to display content until the user gives it permission to enter fullscreen mode. Or even if it's not refusing to display content, it may simply not scale the content up to the full window if the user neglects to give permission for full screen. This could lead to the problem that Hixie mentions, of training users to click through security dialogs, even if this is done through a drop-down asynchronous notification instead of a modal dialog.

If a user clicks a fullscreen button, and declines to give permission to the site to actually use the whole screen, the behavior should probably be to simply resize the element to the full viewport. A standard interface (close button, or escape key, or the like) could then take the element back out of fullscreen (or in this case, full viewport) mode; the application would behave the same as if it were in fullscreen mode, it would just be constrained within the window without knowing it. If the user does give permission, using an asynchronous notification drop down or similar interface, then the browser would have to send a resize event or something like that to let the application know that it needs to resize again. The beginfullscreen/endfullscreen events, and pseudoclass, would apply when resizing to the full window, if full screen permission hasn't been granted.

This would also help applications deal more gracefully with users who don't give permission to go full screen; the application would likely have to do the resizing to the full window itself if it doesn't get permission to use the full screen, but it won't know how long to wait before deciding that the user hasn't given permission. This way, it would resize immediately and automatically to the viewport before permission is granted, and resize again to the full screen if permission has been granted.

-- Brian


More information about the whatwg mailing list