Gecko:FullScreenAPI: Difference between revisions

Line 39: Line 39:
New methods of Document:
New methods of Document:


* void requestFullScreen()
* void cancelFullScreen()
* void requestFullScreenWithKeys()


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 or requestFullScreenWithKeys.
Requests that the UA exit fullscreen mode. The UA is not required to honor this, for example the UA might require that only a Document that last triggered fullscreen can cancel it.


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.
The current fullscreen element for the document is cleared.


The current fullscreen element for the document is cleared.
New attributes of Element:


* void cancelFullScreen()
* const unsigned short ALLOW_KEYBOARD_INPUT = 1


Requests that the UA exit fullscreen mode. The UA is not required to honor this, for example the UA might require that only a Document that last triggered fullscreen can cancel it.
New methods of Element:


The current fullscreen element for the document is cleared.
* void requestFullScreen(unsigned short flags)


New methods of Element:
The current fullscreen element for the document is set to this element.


* void requestFullScreen()
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.
* void requestFullScreenWithKeys()


Just as if requestFullScreen/requestFullScreenWithKeys were called on the element's owner document, except that the current fullscreen element for the document is set to this element.
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.


New DOM attribute of Document:
New DOM attribute of Document:
Line 67: Line 65:
Returns true while the document is in the fullscreen state.
Returns true while the document is in the fullscreen state.


* readonly attribute boolean fullScreenKeysEnabled
* readonly attribute boolean fullScreenKeyboardInputAllowed


Returns true while the window's toplevel browsing context is fullscreen and not in a "keys disabled" state.
Returns true while the window's toplevel browsing context is fullscreen and not in a "keys disabled" state.
Line 75: Line 73:
* allowfullscreen
* allowfullscreen


This is a boolean attribute. When this attribute is not set, UAs should ignore fullscreen requests in the iframe or its descendants.
This is a boolean attribute. When this attribute is not set, UAs should ignore fullscreen requests in the iframe or its descendant frames.


New events:
New events:
Line 91: Line 89:
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-doc
* :full-screen-document
 
While a Document is in the fullscreen state, the 'full-screen-doc' pseudoclass applies to the root element of that Document.
 
* :full-screen-doc-with-target


While a Document is in the fullscreen state and the document's current fullscreen element is an element in the document, the 'full-screen-doc-with-target' pseudoclass applies to the root element of that Document.
While a Document is in the fullscreen state, the 'full-screen-document' pseudoclass applies to the root element of that Document.


Suggested UA stylesheet rule:
Suggested UA stylesheet rule:


  :full-screen {
/* A fullscreen element that is not the root element should be stretched
    to cover the viewport. */
  :full-screen:not(:root) {
   position:fixed;
   position:fixed;
   top:0;
   top:0;
Line 110: Line 106:
   background:black;
   background:black;
  }
  }
  :full-screen-root-with-target {
/* In fullscreen mode, if the root element itself is not fullscreen then
    we should hide the viewport scrollbar. */
  :full-screen-document:not(:full-screen) {
   overflow:hidden;
   overflow:hidden;
  }
  }
1,295

edits