[whatwg] [fullscreen] cancelFullScreen()

Anne van Kesteren annevk at opera.com
Thu Oct 13 09:39:21 PDT 2011

On Thu, 13 Oct 2011 19:21:59 +0900, Chris Pearce <cpearce at mozilla.com>  
> On 13/10/2011 5:23 p.m., Anne van Kesteren wrote:
>> Is the event dispatched synchronously as well then? I was thinking
>> that maybe you want to trigger an animation here of some kind. Though
>> I suppose that could be done synchronously as well.
> It would also be nice if the page can keep rendering and running JS
> while the animation is running. Asynchronous dispatch would allow that.
> Also ideally you'd want to dispatch the event after the animation is
> complete, so that the size of the document's view port is stable; if you
> dispatched the event before your animation is complete, the full-screen
> element's dimensions may not have reached the viewport size, and content
> might get confused, or at worst inconvenienced.

Exactly, so then it seems that cancelFullscreen() should return early and  
queue a task to do the animation, change state, and fire the event.

>> It seems to me that "being fullscreen" is a property of the top-level
>> browsing context. All that is potentially associated with a document
>> is the "fullscreen element". If you have a document A with two
>> sub-documents B and C, it does not make much sense to me that if you
>> go fullscreen from B, C would not report as "being fullscreen". I mean
>> sure, there is no "fullscreen element" but it is definitely rendered
>> fullscreen.
> As the proposed spec is written so far, I think Document.fullscreen is
> meant to convey that:
>  1. If the document's full-screen element in the document, the
>     full-screen element is rendered at viewport dimensions with browser
>     UI hidden, or
>  2. if the document's full-screen element is not in the document, the
>     document is rendered at viewport dimensions.
> The key is the  :full-screen psuedo-class, for which the suggested UA
> style rules enables the full-screen element appear to "break out" of
> containing frames and be rendered at the view-port size (assuming the
> browser window is made viewport dimensions by the UA).
> The :full-screen pseudo-class is defined to also apply to "an <iframe>,
> <object> or <embed> element whose child browsing context's Document is
> in the full-screen state". So if a child document in an iframe doesn't
> have its full-screen element in the document, unless the document
> reports being in full-screen state the :full-screen pseudo-class won't
> apply to that document, and that document thus won't be rendered at
> viewport dimensions.
> If we specified a Document.currentFullScreenElement attribute, then
> Document.fullScreen would be equivalent to
> (Document.currentFullScreenElement != null).

Ah right, my assumption was we would have document.fullscreenElement. My  
point was mainly that what goes fullscreen is not some Document, but it is  
the top-level browsing context.

Anne van Kesteren

More information about the whatwg mailing list