Style vendor prefixes should start with first char uppercase, js properties should be lower

This commit is contained in:
Gregers Gram Rygg
2012-06-23 22:46:43 +02:00
parent b9670a292b
commit 6d5f5c37df
2 changed files with 12 additions and 8 deletions

View File

@@ -1512,7 +1512,7 @@ OpenLayers.Util.getBrowserName = function() {
* Constant: VENDOR_PREFIXES
* {Array} A list of prefixes to test support for vendor-prefixed properties
*/
OpenLayers.Util.VENDOR_PREFIXES = ["", "O", "ms", "Moz", "webkit"];
OpenLayers.Util.VENDOR_PREFIXES = ["", "O", "ms", "Moz", "Webkit"];
/**
* Method: getVendorPrefixedCss
@@ -1530,8 +1530,7 @@ OpenLayers.Util.getVendorPrefixedCss = (function() {
function domToCss(prefixedDom) {
return prefixedDom.
replace(/([A-Z])/g, function(char) { return "-" + char.toLowerCase(); }).
replace(/^ms-/, "-ms-").
replace(/^webkit-/, "-webkit-");
replace(/^ms-/, "-ms-");
}
return function(property) {
@@ -1575,12 +1574,17 @@ OpenLayers.Util.getVendorPrefixedObj = (function() {
var tmpProp,
i = 0,
l = OpenLayers.Util.VENDOR_PREFIXES.length,
prefix;
prefix,
isStyleObj = (typeof obj.cssText !== "undefined");
cache[property] = null;
for(var i=0,l=OpenLayers.Util.VENDOR_PREFIXES.length; i<l; i++) {
prefix = OpenLayers.Util.VENDOR_PREFIXES[i];
if(prefix) {
if (!isStyleObj) {
// js properties should be lower-case
prefix = prefix.toLowerCase();
}
tmpProp = prefix + property.charAt(0).toUpperCase() + property.slice(1);
} else {
tmpProp = property;