W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2010

[whatwg] api for fullscreen()

From: Simon Fraser <smfr@me.com>
Date: Sat, 30 Jan 2010 13:12:47 -0800
Message-ID: <F8826FFC-B3CD-48B4-B2CE-00DA2FDB1F51@me.com>
On Jan 29, 2010, at 9:54 PM, Robert O'Callahan wrote:

> So how about a Window API with an optional element component:
> void enterFullscreen(optional DOMElement element, optional boolean enableKeys);
> void exitFullscreen();
> boolean attribute supportsFullscreen;
> boolean attribute displayingFullscreen;
> "beginfullscreen" and "endfullscreen" events
> 
> Where "beginfullscreen" and "endfullscreen" are targeted at the element if one was provided, or else at the window, and bubble. While a window is fullscreen, the root element and the designated fullscreen element, if any, are given a pseudoclass "fullscreen". Then you can have some default rules in the UA style sheet:
> *:root:fullscreen { overflow:hidden; }
> *:not(:root):fullscreen { position:fixed; left:0; top:0; bottom:0; right:0; }

I'll go for that.

Another good argument to have this API on the window object is that fullscreen is effectively a state on the window. It would not make any sense to go fullscreen on one element, and then fullscreen on another element.

Should enterFullscreen() throw an exception if already fullscreen?

Simon
Received on Saturday, 30 January 2010 13:12:47 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:20 UTC