mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-05 18:55:04 +00:00
Remove browser specific detection code for CSS transforms (#8751)
This commit is contained in:
@ -15,8 +15,6 @@ import * as Util from './Util';
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const style = document.documentElement.style;
|
|
||||||
|
|
||||||
// @property webkit: Boolean;
|
// @property webkit: Boolean;
|
||||||
// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).
|
// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).
|
||||||
const webkit = userAgentContains('webkit');
|
const webkit = userAgentContains('webkit');
|
||||||
@ -33,22 +31,12 @@ const safari = !chrome && userAgentContains('safari');
|
|||||||
// @property win: Boolean; `true` when the browser is running in a Windows platform
|
// @property win: Boolean; `true` when the browser is running in a Windows platform
|
||||||
const win = navigator.platform.startsWith('Win');
|
const win = navigator.platform.startsWith('Win');
|
||||||
|
|
||||||
// @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.
|
|
||||||
const webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix());
|
|
||||||
|
|
||||||
// @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.
|
|
||||||
const gecko3d = 'MozPerspective' in style;
|
|
||||||
|
|
||||||
// @property mobile: Boolean; `true` for all browsers running in a mobile device.
|
// @property mobile: Boolean; `true` for all browsers running in a mobile device.
|
||||||
const mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');
|
const mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');
|
||||||
|
|
||||||
// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.
|
// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.
|
||||||
const mobileWebkit = mobile && webkit;
|
const mobileWebkit = mobile && webkit;
|
||||||
|
|
||||||
// @property mobileWebkit3d: Boolean
|
|
||||||
// `true` for all webkit-based browsers in a mobile device supporting CSS transforms.
|
|
||||||
const mobileWebkit3d = mobile && webkit3d;
|
|
||||||
|
|
||||||
// @property pointer: Boolean
|
// @property pointer: Boolean
|
||||||
// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).
|
// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).
|
||||||
const pointer = !!window.PointerEvent;
|
const pointer = !!window.PointerEvent;
|
||||||
@ -114,11 +102,8 @@ export default {
|
|||||||
gecko,
|
gecko,
|
||||||
safari,
|
safari,
|
||||||
win,
|
win,
|
||||||
webkit3d,
|
|
||||||
gecko3d,
|
|
||||||
mobile,
|
mobile,
|
||||||
mobileWebkit,
|
mobileWebkit,
|
||||||
mobileWebkit3d,
|
|
||||||
pointer,
|
pointer,
|
||||||
touch,
|
touch,
|
||||||
touchNative,
|
touchNative,
|
||||||
|
Reference in New Issue
Block a user