Changes

Jump to: navigation, search

Gecko:FullScreenAPI

174 bytes added, 11:34, 30 June 2010
Proposed Specification
== Proposed Specification ==
A Window Document can be in the "fullscreen state". What exactly this means is up to the UA, but typically it means that the Window Document covers most or all of the screen and some or all of the normal UA UI is not visible.
It is possible for non-toplevel browsing contexts to have their Window Document in the fullscreen state. The parent browsing context of a browsing context with its Window Document in the fullscreen state must also have its Window Document in the fullscreen state.
The user agent may transition a Window Document into or out of the fullscreen state at any time, whether or not script has requested it. User agents are encouraged to provide standard UI to exit the fullscreen state, for example if the user presses the Escape key.
Toplevel browsing contexts can be in a "keys disabled" state. In this state,
the user agent must suppress all keyup, keydown and keypress events whose keyCode is not in one of the following ranges:
-- DOM_VK_CANCEL to DOM_VK_CAPS_LOCK, inclusive
-- DOM_VK_SPACE to DOM_VK_DELETE, inclusive
-- DOM_VK_SEMICOLON to DOM_VK_EQUALS, inclusive
-- DOM_VK_MULTIPLY to DOM_VK_META, inclusive
Such events are not dispatched to any nodes in any document of the toplevel browsing context or descendant browsing contexts. This includes suppression of any internal key event processing that would insert text into form controls or editable content. The user agent might respond to such events by leaving fullscreen mode.
Each document has an optional "current fullscreen element".
New methods of WindowDocument:
* void requestFullScreen(Element target)* void requestFullScreenWithKeys()
Typically the user agent would react to requestFullScreen by transitioning the Window Document to the fullscreen state, or by presenting asynchronous confirmation UI and transitioning to the fullscreen state if/when the user responds affirmatively. However, the user agent is not required to do anything at all in response to requestFullScreen. When a Window transitions to or from the fullscreen state, the UA might use 'target' as a hint to display a smooth visual transition effectrequestFullScreenWithKeys.
The current requestFullScreen hints to the UA that while in fullscreen element state, the toplevel browsing context for this Document should have keys disabled. While keys are disabled, there may be a reduced risk of spoofing attacks inducing the document is set user to 'target' (which input inappropriate data, and the UA may be null)choose to relax restrictions on entering fullscreen state with keys disabled.
The current fullscreen element for the document is cleared. * void requestFullScreenDisableKeyscancelFullScreen(Element target)
As requestFullScreenRequests that the UA exit fullscreen mode. The UA is not required to honor this, but hints to for example the UA might require that only a Document that while in last triggered fullscreen state, the toplevel browsing context for this Window should also have keys disabledcan cancel it.
While keys are disabled, there may be a reduced risk of spoofing attacks inducing The current fullscreen element for the user to input inappropriate data, and the UA may choose to relax restrictions on entering fullscreen state if keys will be disableddocument is cleared.
* void cancelFullScreen()New methods of Element:
Requests that the UA exit fullscreen mode. The UA is not required to honor this, for example the UA might require that only a Window that last triggered fullscreen can cancel it.* void requestFullScreen()* void requestFullScreenWithKeys()
The Just as if requestFullScreen/requestFullScreenWithKeys were called on the element's owner document, except that the current fullscreen element for the document is clearedset to this element.
New DOM attribute of WindowDocument:
* readonly attribute boolean fullScreen
Returns true while the window document is in the fullscreen state.
* readonly attribute boolean fullScreenKeysEnabled
Returns true while the window's toplevel browsing context is fullscreen and not in a "keys disabled" state.
New content attribute of the <iframe> element:
* fullscreenchange
When a Window Document enters or leaves the fullscreen state, the user agent must queue a task to dispatch this event. When the event is dispatched, if the document's current fullscreen element is an element in the Window's document, then the event target is that element, otherwise the event target is the Windowdocument. The event bubbles and is not cancelablecancellable.
The 'onfullscreenchange' event handling attribute is supported on HTML elements.
* :full-screen
While a Window Document is in the fullscreen state, and the document's current fullscreen element is an element in the Window's document, the 'full-screen' pseudoclass applies to that element. Also, an <iframe>, <object> or <embed> element whose child browsing context's Window Document is in the fullscreen state has the 'full-screen' pseudoclass applied.
* :full-screen-root
While a Window Document is in the fullscreen state, the 'full-screen-root' pseudoclass applies to the root element of that Window's documentDocument.
Suggested UA stylesheet rule:
1,295
edits

Navigation menu