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 d87ca4f80d137b320e4353c1a6d38b7594ad2cd7..0ad6f36e686dcb8ca5707affc6969a3266b221d4 100644 |
--- a/sdk/lib/html/dartium/html_dartium.dart |
+++ b/sdk/lib/html/dartium/html_dartium.dart |
@@ -6188,15 +6188,11 @@ class CssStyleDeclaration extends DartHtmlDomObject |
/// Please note the property name uses camelCase, not-hyphens. |
String getPropertyValue(String propertyName) { |
var propValue = _getPropertyValueHelper(propertyName); |
- return propValue != null ? propValue : ''; |
+ return propValue ?? ''; |
} |
String _getPropertyValueHelper(String propertyName) { |
- if (_supportsProperty(_camelCase(propertyName))) { |
- return _getPropertyValue(propertyName); |
- } else { |
- return _getPropertyValue(Device.cssPrefix + propertyName); |
- } |
+ return _getPropertyValue(_browserPropertyName(propertyName)); |
} |
/** |
@@ -6209,7 +6205,7 @@ class CssStyleDeclaration extends DartHtmlDomObject |
*/ |
bool supportsProperty(String propertyName) { |
return _supportsProperty(propertyName) || |
- _supportsProperty(_camelCase(Device.cssPrefix + propertyName)); |
+ _supportsProperty(_camelCase("${Device.cssPrefix}$propertyName")); |
} |
bool _supportsProperty(String propertyName) { |
@@ -6234,15 +6230,23 @@ class CssStyleDeclaration extends DartHtmlDomObject |
String _browserPropertyName(String propertyName) { |
String name = _readCache(propertyName); |
if (name is String) return name; |
- if (_supportsProperty(_camelCase(propertyName))) { |
- name = propertyName; |
- } else { |
- name = Device.cssPrefix + propertyName; |
- } |
+ name = _supportedBrowserPropertyName(propertyName); |
_writeCache(propertyName, name); |
return name; |
} |
+ String _supportedBrowserPropertyName(String propertyName) { |
+ if (_supportsProperty(_camelCase(propertyName))) { |
+ return propertyName; |
+ } |
+ var prefixed = "${Device.cssPrefix}$propertyName"; |
+ if (_supportsProperty(prefixed)) { |
+ return prefixed; |
+ } |
+ // May be a CSS variable, just use it as provided. |
+ return propertyName; |
+ } |
+ |
static String _readCache(String key) => null; |
static void _writeCache(String key, value) {} |