// Matches dashed string for camelizing
rdashAlpha = /-([a-z]|[0-9])/ig,
+ rmsPrefix = /^-ms-/,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
}
},
- // Converts a dashed string to camelCased string;
- // Used by both the css and data modules
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
- return string.replace( rdashAlpha, fcamelCase );
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
nodeName: function( elem, name ) {
var tests = {
"foo-bar": "fooBar",
- "foo-bar-baz": "fooBarBaz"
+ "foo-bar-baz": "fooBarBaz",
+ "girl-u-want": "girlUWant",
+ "the-4th-dimension": "the4thDimension",
+ "-o-tannenbaum": "OTannenbaum",
+ "-moz-illa": "MozIlla",
+ "-ms-take": "msTake"
};
- expect(2);
+ expect(7);
jQuery.each( tests, function( key, val ) {
equal( jQuery.camelCase( key ), val, "Converts: " + key + " => " + val );