Comparing version 2.2.0 to 2.3.0
'use strict'; | ||
// autogenerated - 1/20/2020 | ||
// autogenerated - 4/29/2020 | ||
@@ -261,3 +261,2 @@ /* | ||
'margin-top', | ||
'margin-trim', | ||
'marker-side', | ||
@@ -349,2 +348,5 @@ 'mask', | ||
'resize', | ||
'rest', | ||
'rest-after', | ||
'rest-before', | ||
'richness', | ||
@@ -391,2 +393,3 @@ 'right', | ||
'speak', | ||
'speak-as', | ||
'speak-header', | ||
@@ -437,3 +440,10 @@ 'speak-numeral', | ||
'visibility', | ||
'voice-balance', | ||
'voice-duration', | ||
'voice-family', | ||
'voice-pitch', | ||
'voice-range', | ||
'voice-rate', | ||
'voice-stress', | ||
'voice-volume', | ||
'volume', | ||
@@ -440,0 +450,0 @@ 'white-space', |
@@ -550,2 +550,8 @@ 'use strict'; | ||
}); | ||
test('supports calc', () => { | ||
const style = new CSSStyleDeclaration(); | ||
style.setProperty('width', 'calc(100% - 100px)'); | ||
expect(style.getPropertyValue('width')).toEqual('calc(100% - 100px)'); | ||
}); | ||
}); |
'use strict'; | ||
// autogenerated - 1/23/2020 | ||
// autogenerated - 4/29/2020 | ||
@@ -5,0 +5,0 @@ /* |
@@ -21,2 +21,3 @@ /********************************************************************* | ||
NULL_OR_EMPTY_STR: 10, | ||
CALC: 11, | ||
}; | ||
@@ -34,2 +35,3 @@ | ||
var colorRegEx3 = /^rgba\(([^)]*)\)$/; | ||
var calcRegEx = /^calc\(([^)]*)\)$/; | ||
var colorRegEx4 = /^hsla?\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*(,\s*(-?\d+|-?\d*.\d+)\s*)?\)/; | ||
@@ -66,2 +68,5 @@ var angleRegEx = /^([-+]?[0-9]*\.?[0-9]+)(deg|grad|rad)$/; | ||
} | ||
if (calcRegEx.test(val)) { | ||
return exports.TYPES.CALC; | ||
} | ||
if (stringRegEx.test(val)) { | ||
@@ -76,2 +81,3 @@ return exports.TYPES.STRING; | ||
} | ||
var res = colorRegEx2.exec(val); | ||
@@ -208,2 +214,7 @@ var parts; | ||
exports.parseMeasurement = function parseMeasurement(val) { | ||
var type = exports.valueType(val); | ||
if (type === exports.TYPES.CALC) { | ||
return val; | ||
} | ||
var length = exports.parseLength(val); | ||
@@ -210,0 +221,0 @@ if (length !== undefined) { |
@@ -68,2 +68,9 @@ 'use strict'; | ||
}); | ||
it('returns calc from calc(100px * 2)', () => { | ||
let input = 'calc(100px * 2)'; | ||
let output = parsers.valueType(input); | ||
expect(output).toEqual(parsers.TYPES.CALC); | ||
}); | ||
}); | ||
@@ -70,0 +77,0 @@ describe('parseInteger', () => { |
'use strict'; | ||
// autogenerated - 1/23/2020 | ||
// autogenerated - 4/29/2020 | ||
@@ -5,0 +5,0 @@ /* |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "2.2.0", | ||
"version": "2.3.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
176221
5734