mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-07-29 11:53:03 +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;
|
||||
// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).
|
||||
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
|
||||
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.
|
||||
const mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');
|
||||
|
||||
// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.
|
||||
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
|
||||
// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).
|
||||
const pointer = !!window.PointerEvent;
|
||||
@ -114,11 +102,8 @@ export default {
|
||||
gecko,
|
||||
safari,
|
||||
win,
|
||||
webkit3d,
|
||||
gecko3d,
|
||||
mobile,
|
||||
mobileWebkit,
|
||||
mobileWebkit3d,
|
||||
pointer,
|
||||
touch,
|
||||
touchNative,
|
||||
|
Reference in New Issue
Block a user