File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ var jQuery = function( selector, context ) {
4747
4848 // Matches dashed string for camelizing
4949 rdashAlpha = / - ( [ a - z ] | [ 0 - 9 ] ) / ig,
50+ rmsPrefix = / ^ - m s - / ,
5051
5152 // Used by jQuery.camelCase as callback to replace()
5253 fcamelCase = function ( all , letter ) {
@@ -590,10 +591,10 @@ jQuery.extend({
590591 }
591592 } ,
592593
593- // Converts a dashed string to camelCased string;
594- // Used by both the css and data modules
594+ // Convert dashed to camelCase; used by the css and data modules
595+ // Microsoft forgot to hump their vendor prefix (#9572)
595596 camelCase : function ( string ) {
596- return string . replace ( rdashAlpha , fcamelCase ) ;
597+ return string . replace ( rmsPrefix , "ms-" ) . replace ( rdashAlpha , fcamelCase ) ;
597598 } ,
598599
599600 nodeName : function ( elem , name ) {
Original file line number Diff line number Diff line change @@ -1129,10 +1129,15 @@ test("jQuery.camelCase()", function() {
11291129
11301130 var tests = {
11311131 "foo-bar" : "fooBar" ,
1132- "foo-bar-baz" : "fooBarBaz"
1132+ "foo-bar-baz" : "fooBarBaz" ,
1133+ "girl-u-want" : "girlUWant" ,
1134+ "the-4th-dimension" : "the4thDimension" ,
1135+ "-o-tannenbaum" : "OTannenbaum" ,
1136+ "-moz-illa" : "MozIlla" ,
1137+ "-ms-take" : "msTake"
11331138 } ;
11341139
1135- expect ( 2 ) ;
1140+ expect ( 7 ) ;
11361141
11371142 jQuery . each ( tests , function ( key , val ) {
11381143 equal ( jQuery . camelCase ( key ) , val , "Converts: " + key + " => " + val ) ;
You can’t perform that action at this time.
0 commit comments