W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2011

[whatwg] Fullscreen Update

From: Mikko Rantalainen <mikko.rantalainen@peda.net>
Date: Thu, 20 Oct 2011 15:27:44 +0300
Message-ID: <4EA013C0.5020604@peda.net>
2011-10-19 17:45 EEST: Glenn Maynard:
> b.onclick = function(e) {
>     if(document.fullscreen)
>         document.exitFullscreen();
>     else
>         gameDiv.enterFullScreen();
> }

In fact, the most obvious code should be

b.onclick = function(e) {
    if(gameDiv.fullscreen)
        gameDiv.exitFullscreen();
    else
        gameDiv.enterFullScreen();
}

> If F11-fullscreen sets document.fullscreen, this breaks; enterFullScreen
> would never be called. 

Yes. If the web developer is going to fullscreen a single element, he
should test if that element is fullscreen instead of testing if the
whole document is fullscreen, IMHO.

-- 
Mikko
Received on Thursday, 20 October 2011 05:27:44 UTC

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