File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ CSSStyleDeclaration.prototype = {
35
35
* Returns the empty string if the property has not been set.
36
36
*/
37
37
getPropertyValue : function ( name ) {
38
+ if ( name . indexOf ( '--' ) === 0 && this . hasOwnProperty ( name ) ) {
39
+ return this [ name ] ;
40
+ }
38
41
if ( ! this . _values . hasOwnProperty ( name ) ) {
39
42
return '' ;
40
43
}
@@ -56,13 +59,19 @@ CSSStyleDeclaration.prototype = {
56
59
this . removeProperty ( name ) ;
57
60
return ;
58
61
}
59
- var lowercaseName = name . toLowerCase ( ) ;
60
- if ( ! allProperties . has ( lowercaseName ) && ! allExtraProperties . has ( lowercaseName ) ) {
62
+ var isCustomProperty = name . indexOf ( '--' ) === 0 ;
63
+ // custom properties are case-sensitive
64
+ var propertyName = isCustomProperty ? name : name . toLowerCase ( ) ;
65
+ if (
66
+ ! isCustomProperty &&
67
+ ! allProperties . has ( propertyName ) &&
68
+ ! allExtraProperties . has ( propertyName )
69
+ ) {
61
70
return ;
62
71
}
63
72
64
- this [ lowercaseName ] = value ;
65
- this . _importants [ lowercaseName ] = priority ;
73
+ this [ propertyName ] = value ;
74
+ this . _importants [ propertyName ] = priority ;
66
75
} ,
67
76
_setProperty : function ( name , value , priority ) {
68
77
if ( value === undefined ) {
You can’t perform that action at this time.
0 commit comments