@@ -51,31 +51,26 @@ function fullScreen(state)
5151 if ( state == null )
5252 {
5353 // When fullscreen mode is not supported then return null
54- if ( ! ( ( /** @type {?Function } */ doc [ "cancelFullScreen" ] )
54+ if ( ! ( ( /** @type {?Function } */ doc [ "exitFullscreen" ] )
55+ || ( /** @type {?Function } */ doc [ "webkitExitFullscreen" ] )
5556 || ( /** @type {?Function } */ doc [ "webkitCancelFullScreen" ] )
5657 || ( /** @type {?Function } */ doc [ "msExitFullscreen" ] )
5758 || ( /** @type {?Function } */ doc [ "mozCancelFullScreen" ] ) ) )
5859 {
5960 return null ;
6061 }
6162
62- // In theory this should not be necessary but looks like IE11
63- // has a bug here. msFullscreenEnabled always returns true. So
64- // this workaround also checks if msFullScreenElement is null and
65- // returns false in this case
66- if ( doc [ "msFullscreenEnabled" ] && ! doc [ "msFullscreenElement" ] )
67- return false ;
68-
6963 // Check fullscreen state
70- state = ! ! doc [ "fullScreen" ]
64+ state = ! ! doc [ "fullscreenElement" ]
65+ || ! ! doc [ "msFullscreenElement" ]
7166 || ! ! doc [ "webkitIsFullScreen" ]
72- || ! ! doc [ "msFullscreenEnabled" ]
7367 || ! ! doc [ "mozFullScreen" ] ;
7468 if ( ! state ) return state ;
7569
7670 // Return current fullscreen element or "true" if browser doesn't
7771 // support this
78- return ( /** @type {?Element } */ doc [ "fullScreenElement" ] )
72+ return ( /** @type {?Element } */ doc [ "fullscreenElement" ] )
73+ || ( /** @type {?Element } */ doc [ "webkitFullscreenElement" ] )
7974 || ( /** @type {?Element } */ doc [ "webkitCurrentFullScreenElement" ] )
8075 || ( /** @type {?Element } */ doc [ "msFullscreenElement" ] )
8176 || ( /** @type {?Element } */ doc [ "mozFullScreenElement" ] )
@@ -86,7 +81,8 @@ function fullScreen(state)
8681 if ( state )
8782 {
8883 // Enter fullscreen
89- func = ( /** @type {?Function } */ e [ "requestFullScreen" ] )
84+ func = ( /** @type {?Function } */ e [ "requestFullscreen" ] )
85+ || ( /** @type {?Function } */ e [ "webkitRequestFullscreen" ] )
9086 || ( /** @type {?Function } */ e [ "webkitRequestFullScreen" ] )
9187 || ( /** @type {?Function } */ e [ "msRequestFullscreen" ] )
9288 || ( /** @type {?Function } */ e [ "mozRequestFullScreen" ] ) ;
@@ -102,7 +98,8 @@ function fullScreen(state)
10298 else
10399 {
104100 // Exit fullscreen
105- func = ( /** @type {?Function } */ doc [ "cancelFullScreen" ] )
101+ func = ( /** @type {?Function } */ doc [ "exitFullscreen" ] )
102+ || ( /** @type {?Function } */ doc [ "webkitExitFullscreen" ] )
106103 || ( /** @type {?Function } */ doc [ "webkitCancelFullScreen" ] )
107104 || ( /** @type {?Function } */ doc [ "msExitFullscreen" ] )
108105 || ( /** @type {?Function } */ doc [ "mozCancelFullScreen" ] ) ;
0 commit comments