@@ -51,31 +51,26 @@ function fullScreen(state)
51
51
if ( state == null )
52
52
{
53
53
// 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" ] )
55
56
|| ( /** @type {?Function } */ doc [ "webkitCancelFullScreen" ] )
56
57
|| ( /** @type {?Function } */ doc [ "msExitFullscreen" ] )
57
58
|| ( /** @type {?Function } */ doc [ "mozCancelFullScreen" ] ) ) )
58
59
{
59
60
return null ;
60
61
}
61
62
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
-
69
63
// Check fullscreen state
70
- state = ! ! doc [ "fullScreen" ]
64
+ state = ! ! doc [ "fullscreenElement" ]
65
+ || ! ! doc [ "msFullscreenElement" ]
71
66
|| ! ! doc [ "webkitIsFullScreen" ]
72
- || ! ! doc [ "msFullscreenEnabled" ]
73
67
|| ! ! doc [ "mozFullScreen" ] ;
74
68
if ( ! state ) return state ;
75
69
76
70
// Return current fullscreen element or "true" if browser doesn't
77
71
// support this
78
- return ( /** @type {?Element } */ doc [ "fullScreenElement" ] )
72
+ return ( /** @type {?Element } */ doc [ "fullscreenElement" ] )
73
+ || ( /** @type {?Element } */ doc [ "webkitFullscreenElement" ] )
79
74
|| ( /** @type {?Element } */ doc [ "webkitCurrentFullScreenElement" ] )
80
75
|| ( /** @type {?Element } */ doc [ "msFullscreenElement" ] )
81
76
|| ( /** @type {?Element } */ doc [ "mozFullScreenElement" ] )
@@ -86,7 +81,8 @@ function fullScreen(state)
86
81
if ( state )
87
82
{
88
83
// Enter fullscreen
89
- func = ( /** @type {?Function } */ e [ "requestFullScreen" ] )
84
+ func = ( /** @type {?Function } */ e [ "requestFullscreen" ] )
85
+ || ( /** @type {?Function } */ e [ "webkitRequestFullscreen" ] )
90
86
|| ( /** @type {?Function } */ e [ "webkitRequestFullScreen" ] )
91
87
|| ( /** @type {?Function } */ e [ "msRequestFullscreen" ] )
92
88
|| ( /** @type {?Function } */ e [ "mozRequestFullScreen" ] ) ;
@@ -102,7 +98,8 @@ function fullScreen(state)
102
98
else
103
99
{
104
100
// Exit fullscreen
105
- func = ( /** @type {?Function } */ doc [ "cancelFullScreen" ] )
101
+ func = ( /** @type {?Function } */ doc [ "exitFullscreen" ] )
102
+ || ( /** @type {?Function } */ doc [ "webkitExitFullscreen" ] )
106
103
|| ( /** @type {?Function } */ doc [ "webkitCancelFullScreen" ] )
107
104
|| ( /** @type {?Function } */ doc [ "msExitFullscreen" ] )
108
105
|| ( /** @type {?Function } */ doc [ "mozCancelFullScreen" ] ) ;
0 commit comments