Gecko:FullScreenAPI: Difference between revisions

No edit summary
Line 37: Line 37:
Each document has an optional "current fullscreen element".
Each document has an optional "current fullscreen element".


New methods of Document:
New method of Document:


* void cancelFullScreen()
* void cancelFullScreen()
Line 44: Line 44:


The current fullscreen element for the document is cleared.
The current fullscreen element for the document is cleared.
New attributes of Element:
* readonly attribute unsigned short ALLOW_KEYBOARD_INPUT = 1


New methods of Element:
New methods of Element:


* void requestFullScreen(unsigned short flags)
* void requestFullScreen()


The current fullscreen element for the document is set to this element.
The current fullscreen element for the document is set to this element.
Line 57: Line 53:
Typically the user agent would react by transitioning the 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. The user agent's behavior is allowed to vary depending on whether requestFullScreen is called during a user event (e.g. a mouse click handler).
Typically the user agent would react by transitioning the 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. The user agent's behavior is allowed to vary depending on whether requestFullScreen is called during a user event (e.g. a mouse click handler).


When the ALLOW_KEYBOARD_INPUT flag is not specified, requestFullScreen hints to the UA that while in fullscreen 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 user to input inappropriate data, and the UA may choose to relax restrictions on entering fullscreen state with keys disabled.
* void requestFullScreenWithKeys()
 
As requestFullScreen, but hints to the UA that while in fullscreen 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 user to input inappropriate data, and the UA may choose to relax restrictions on entering fullscreen state with keys disabled.


New DOM attribute of Document:
New DOM attribute of Document:
Line 83: Line 81:
The 'onfullscreenchange' event handling attribute is supported on HTML elements.
The 'onfullscreenchange' event handling attribute is supported on HTML elements.


New CSS psuedoclasses:
New CSS psuedoclass:


* :full-screen
* :full-screen
Line 89: Line 87:
While a Document is in the fullscreen state, and the document's current fullscreen element is an element in the document, the 'full-screen' pseudoclass applies to that element. Also, an <iframe>, <object> or <embed> element whose child browsing context's Document is in the fullscreen state has the 'full-screen' pseudoclass applied.
While a Document is in the fullscreen state, and the document's current fullscreen element is an element in the document, the 'full-screen' pseudoclass applies to that element. Also, an <iframe>, <object> or <embed> element whose child browsing context's Document is in the fullscreen state has the 'full-screen' pseudoclass applied.


* :full-screen-document
New CSS media type:
 
* fullscreen


While a Document is in the fullscreen state, the 'full-screen-document' pseudoclass applies to all elements of that Document.
While a Document is in the fullscreen state, the fullscreen media type is active for the document.


Suggested UA stylesheet rule:
Suggested UA stylesheet rule:
Line 108: Line 108:
  /* In fullscreen mode, if the root element itself is not fullscreen then
  /* In fullscreen mode, if the root element itself is not fullscreen then
     we should hide the viewport scrollbar. */
     we should hide the viewport scrollbar. */
  :root:full-screen-document:not(:full-screen) {
  @media fullscreen {
  overflow:hidden;
  :root:not(:full-screen) {
    overflow:hidden;
  }
  }
  }


1,295

edits