aboutsummaryrefslogtreecommitdiffstats
path: root/src/css/cssCamelCase.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2019-04-29 21:06:53 +0200
committerGitHub <noreply@github.com>2019-04-29 21:06:53 +0200
commit8fae21200e80647fec4389995c4879948d11ad66 (patch)
treee54dca524d936d0258aebb22b59a20fc4d982431 /src/css/cssCamelCase.js
parenteb6c0a7c97b1b3cf00144de12d945c9c569f935c (diff)
downloadjquery-8fae21200e80647fec4389995c4879948d11ad66.tar.gz
jquery-8fae21200e80647fec4389995c4879948d11ad66.zip
Data: Separate data & css/effects camelCase implementations
The camelCase implementation used by the data module no longer turns `-ms-foo` into `msFoo` but to `MsFoo` now. This is because `data` is supposed to be a generic utility not specifically bound to CSS use cases. Fixes gh-3355 Closes gh-4365
Diffstat (limited to 'src/css/cssCamelCase.js')
-rw-r--r--src/css/cssCamelCase.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/css/cssCamelCase.js b/src/css/cssCamelCase.js
new file mode 100644
index 000000000..9b5c328ad
--- /dev/null
+++ b/src/css/cssCamelCase.js
@@ -0,0 +1,20 @@
+define( [
+ "../core/camelCase"
+], function( camelCase ) {
+
+"use strict";
+
+// Matches dashed string for camelizing
+var rmsPrefix = /^-ms-/;
+
+// Convert dashed to camelCase, handle vendor prefixes.
+// Used by the css & effects modules.
+// Support: IE <=9 - 11+, Edge 12 - 18+
+// Microsoft forgot to hump their vendor prefix (#9572)
+function cssCamelCase( string ) {
+ return camelCase( string.replace( rmsPrefix, "ms-" ) );
+}
+
+return cssCamelCase;
+
+} );