Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 455483002: Make camelcasing use a regular expression for CSS properties. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 6343777b2f9491d35b1c21fe2d24a997c95a03e9..fe31469095b7adf60a131c33c292caf68f222c82 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -3640,18 +3640,10 @@ class CssRule extends NativeFieldWrapperClass2 {
}
String _camelCase(String hyphenated) {
- 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),
+ (match) => match[0][1].toUpperCase() + match[0].substring(2));
}
void _setPropertyHelper(String propertyName, String value, [String priority]) {
@@ -28718,10 +28710,10 @@ class Url extends NativeFieldWrapperClass2 implements UrlUtils {
if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
return _blink.BlinkURL.$_createObjectURL_1_Callback(blob_OR_source_OR_stream);
}
- if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
+ if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
return _blink.BlinkURL.$_createObjectURL_2_Callback(blob_OR_source_OR_stream);
}
- if ((blob_OR_source_OR_stream is MediaSource || blob_OR_source_OR_stream == null)) {
+ if ((blob_OR_source_OR_stream is MediaStream || blob_OR_source_OR_stream == null)) {
return _blink.BlinkURL.$_createObjectURL_3_Callback(blob_OR_source_OR_stream);
}
throw new ArgumentError("Incorrect number or type of arguments");

Powered by Google App Engine
This is Rietveld 408576698