@@ -930,7 +930,7 @@ var LibraryHTML5 = {
930
930
931
931
$screenOrientation : ( ) => {
932
932
if ( ! screen ) return undefined ;
933
- return screen . orientation || screen . mozOrientation || screen . webkitOrientation || screen . msOrientation ;
933
+ return screen . orientation || screen . mozOrientation || screen . webkitOrientation ;
934
934
} ,
935
935
936
936
$fillOrientationChangeEventData__deps : [ '$screenOrientation' ] ,
@@ -943,28 +943,19 @@ var LibraryHTML5 = {
943
943
var orientationIndex = - 1 ;
944
944
var orientationAngle = 0 ;
945
945
var screenOrientObj = screenOrientation ( ) ;
946
- if ( screenOrientObj ) {
947
- var orientationType ;
948
- if ( typeof screenOrientObj === 'object' ) {
949
- orientationType = screenOrientObj . type ;
950
- orientationAngle = screenOrientObj . angle ;
951
- } else {
952
- // Edge only supports the older string type until 2020 (pre-Chrome)
953
- orientationType = String ( screenOrientObj ) ;
954
- }
955
- orientationIndex = orientationsType1 . indexOf ( orientationType ) ;
956
- if ( orientationIndex == - 1 ) {
957
- orientationIndex = orientationsType2 . indexOf ( orientationType ) ;
946
+ if ( typeof screenOrientObj === 'object' ) {
947
+ orientationIndex = orientationsType1 . indexOf ( screenOrientObj . type ) ;
948
+ if ( orientationIndex < 0 ) {
949
+ orientationIndex = orientationsType2 . indexOf ( screenOrientObj . type ) ;
958
950
}
959
- if ( orientationIndex != - 1 ) {
951
+ if ( orientationIndex < 0 ) {
960
952
orientationIndex = 1 << orientationIndex ;
961
953
}
954
+ orientationAngle = screenOrientObj . angle ;
962
955
} else {
963
956
#if MIN_SAFARI_VERSION < 0x100400
964
957
// fallback for Safari earlier than 16.4 (March 2023)
965
- if ( window && ( window [ 'orientation' ] !== undefined ) ) {
966
- orientationAngle = window [ 'orientation' ] ;
967
- }
958
+ orientationAngle = window . orientation ;
968
959
#endif
969
960
}
970
961
0 commit comments