Comparing version 2.1.0 to 2.2.0
@@ -59,2 +59,7 @@ /********************************************************************* | ||
} | ||
var isCustomProperty = name.indexOf('--') === 0; | ||
if (isCustomProperty) { | ||
this._setProperty(name, value, priority); | ||
return; | ||
} | ||
var lowercaseName = name.toLowerCase(); | ||
@@ -61,0 +66,0 @@ if (!allProperties.has(lowercaseName) && !allExtraProperties.has(lowercaseName)) { |
@@ -521,2 +521,31 @@ 'use strict'; | ||
}); | ||
test('getPropertyValue for custom properties in cssText', () => { | ||
const style = new CSSStyleDeclaration(); | ||
style.cssText = '--foo: red'; | ||
expect(style.getPropertyValue('--foo')).toEqual('red'); | ||
}); | ||
test('getPropertyValue for custom properties with setProperty', () => { | ||
const style = new CSSStyleDeclaration(); | ||
style.setProperty('--bar', 'blue'); | ||
expect(style.getPropertyValue('--bar')).toEqual('blue'); | ||
}); | ||
test('getPropertyValue for custom properties with object setter', () => { | ||
const style = new CSSStyleDeclaration(); | ||
style['--baz'] = 'yellow'; | ||
expect(style.getPropertyValue('--baz')).toEqual(''); | ||
}); | ||
test('custom properties are case-sensitive', () => { | ||
const style = new CSSStyleDeclaration(); | ||
style.cssText = '--fOo: purple'; | ||
expect(style.getPropertyValue('--foo')).toEqual(''); | ||
expect(style.getPropertyValue('--fOo')).toEqual('purple'); | ||
}); | ||
}); |
'use strict'; | ||
// autogenerated - 1/20/2020 | ||
// autogenerated - 1/23/2020 | ||
@@ -5,0 +5,0 @@ /* |
'use strict'; | ||
// autogenerated - 1/20/2020 | ||
// autogenerated - 1/23/2020 | ||
@@ -5,0 +5,0 @@ /* |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"homepage": "https://github.com/jsdom/cssstyle", | ||
@@ -12,0 +12,0 @@ "maintainers": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175450
5705