Index: tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate |
diff --git a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate |
index 3155235055f1a6f36dec6e85afe34b029d983385..85360935bafa7a80ed6f9bbba7ac8c449791f4c5 100644 |
--- a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate |
+++ b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate |
@@ -76,18 +76,10 @@ $endif |
} |
String _camelCase(String hyphenated) { |
sra1
2014/08/07 22:16:20
static
|
- bool firstWord = true; |
- return hyphenated.splitMapJoin('-', onMatch : (_) => '', |
- onNonMatch : (String word) { |
- if (word.length > 0) { |
- if (firstWord) { |
- firstWord = false; |
- return word; |
- } |
- return word[0].toUpperCase() + word.substring(1); |
- } |
- return ''; |
- }); |
+ // The "ms" prefix is always lowercased. |
+ return hyphenated.replaceFirst(new RegExp('^-ms-'), 'ms-').replaceAllMapped( |
+ new RegExp('-([a-z]+)', caseSensitive: false), |
sra1
2014/08/07 21:46:38
Put the regexps in private static fields to avoid
|
+ (match) => match[0][1].toUpperCase() + match[0].substring(2)); |
} |
$if DART2JS |