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 = {
3535 * Returns the empty string if the property has not been set.
3636 */
3737 getPropertyValue : function ( name ) {
38+ if ( name . indexOf ( '--' ) === 0 && this . hasOwnProperty ( name ) ) {
39+ return this [ name ] ;
40+ }
3841 if ( ! this . _values . hasOwnProperty ( name ) ) {
3942 return '' ;
4043 }
@@ -56,13 +59,19 @@ CSSStyleDeclaration.prototype = {
5659 this . removeProperty ( name ) ;
5760 return ;
5861 }
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+ ) {
6170 return ;
6271 }
6372
64- this [ lowercaseName ] = value ;
65- this . _importants [ lowercaseName ] = priority ;
73+ this [ propertyName ] = value ;
74+ this . _importants [ propertyName ] = priority ;
6675 } ,
6776 _setProperty : function ( name , value , priority ) {
6877 if ( value === undefined ) {
You can’t perform that action at this time.
0 commit comments