Add gecko3d support to Browser/DomUtil

This commit is contained in:
danzel 2012-06-15 16:29:09 +12:00
parent 51fb9eeacf
commit cc304bf212
2 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,7 @@
var ua = navigator.userAgent.toLowerCase(), var ua = navigator.userAgent.toLowerCase(),
ie = !!window.ActiveXObject, ie = !!window.ActiveXObject,
webkit = ua.indexOf("webkit") !== -1, webkit = ua.indexOf("webkit") !== -1,
gecko = ua.indexOf("gecko") !== -1,
mobile = typeof orientation !== 'undefined' ? true : false, mobile = typeof orientation !== 'undefined' ? true : false,
android = ua.indexOf("android") !== -1, android = ua.indexOf("android") !== -1,
opera = window.opera; opera = window.opera;
@ -13,7 +14,8 @@
webkit: webkit, webkit: webkit,
webkit3d: webkit && ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()), webkit3d: webkit && ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()),
gecko: ua.indexOf("gecko") !== -1, gecko: gecko,
gecko3d: gecko && ('MozPerspective' in document.createElement('div').style),
opera: opera, opera: opera,

View File

@ -139,9 +139,9 @@ L.DomUtil = {
setPosition: function (el, point) { setPosition: function (el, point) {
el._leaflet_pos = point; el._leaflet_pos = point;
if (L.Browser.webkit3d) { if (L.Browser.webkit3d || L.Browser.gecko3d) {
el.style[L.DomUtil.TRANSFORM] = L.DomUtil.getTranslateString(point); el.style[L.DomUtil.TRANSFORM] = L.DomUtil.getTranslateString(point);
el.style['-webkit-backface-visibility'] = 'hidden'; el.style[(L.Browser.webkit3d ? '-webkit' : '-moz') + '-backface-visibility'] = 'hidden';
} else { } else {
el.style.left = point.x + 'px'; el.style.left = point.x + 'px';
el.style.top = point.y + 'px'; el.style.top = point.y + 'px';