Index: tools/dom/scripts/css_code_generator.py |
diff --git a/tools/dom/scripts/css_code_generator.py b/tools/dom/scripts/css_code_generator.py |
index 5230aacf069280df21d0da79c0aa4a1cd0242a43..e7843b515cd754c8635f01bae7fd134735b32c7a 100644 |
--- a/tools/dom/scripts/css_code_generator.py |
+++ b/tools/dom/scripts/css_code_generator.py |
@@ -126,10 +126,18 @@ $endif |
} |
static String _camelCase(String hyphenated) { |
+$if DART2JS |
+ var replacedMs = JS('String', r'#.replace(/^-ms-/, "ms-")', hyphenated); |
+ |
+ var fToUpper = const JS_CONST( |
+ r'function(_, letter) { return letter.toUpperCase(); }'); |
+ return JS('String', r'#.replace(/-([\da-z])/ig, #)', replacedMs, fToUpper); |
+$else |
// The "ms" prefix is always lowercased. |
sra1
2014/08/08 00:49:28
This comment should go outside the $if
|
return hyphenated.replaceFirst(new RegExp('^-ms-'), 'ms-').replaceAllMapped( |
new RegExp('-([a-z]+)', caseSensitive: false), |
(match) => match[0][1].toUpperCase() + match[0].substring(2)); |
+$endif |
} |
$if DART2JS |