diff --git a/lib/CSSStyleDeclaration.test.js b/lib/CSSStyleDeclaration.test.js index 9fa8ed3b..73c194b9 100644 --- a/lib/CSSStyleDeclaration.test.js +++ b/lib/CSSStyleDeclaration.test.js @@ -553,4 +553,20 @@ describe('CSSStyleDeclaration', () => { style.setProperty('width', 'calc(100% - 100px)'); expect(style.getPropertyValue('width')).toEqual('calc(100% - 100px)'); }); + + test('implements webkitTextFillColor', () => { + const style = new CSSStyleDeclaration(); + style.setProperty('-webkit-text-fill-color', '#ffffff66'); + + expect(style.webkitTextFillColor).toEqual('rgba(255, 255, 255, 0.4)'); + }); + + test('vendor property with cssText', () => { + const style = new CSSStyleDeclaration(); + style.cssText = '-webkit-line-clamp: 20'; + + // TODO: this should be a number + expect(style.WebkitLineClamp).toEqual('20'); + expect(style.getPropertyValue('-webkit-line-clamp')).toEqual('20'); + }); }); diff --git a/lib/allWebkitProperties.js b/lib/allWebkitProperties.js index d6e71df6..57b2799b 100644 --- a/lib/allWebkitProperties.js +++ b/lib/allWebkitProperties.js @@ -191,4 +191,4 @@ module.exports = [ 'wrap-through', 'writing-mode', 'zoom', -].map(prop => 'webkit-' + prop); +].map(prop => '-webkit-' + prop); diff --git a/scripts/generate_implemented_properties.js b/scripts/generate_implemented_properties.js index caa88f12..0c21e969 100644 --- a/scripts/generate_implemented_properties.js +++ b/scripts/generate_implemented_properties.js @@ -9,8 +9,15 @@ const camelToDashed = require('../lib/parsers').camelToDashed; const dashedProperties = fs .readdirSync(path.resolve(__dirname, '../lib/properties')) .filter(propertyFile => propertyFile.substr(-3) === '.js') - .map(propertyFile => camelToDashed(propertyFile.replace('.js', ''))); - + .map(propertyFile => camelToDashed(propertyFile.replace('.js', ''))) + .map(property => { + const isVendorSpecific = /^(o|moz|ms|webkit)-/.test(property); + if (isVendorSpecific) { + return '-' + property; + } else { + return property; + } + }); const out_file = fs.createWriteStream(path.resolve(__dirname, '../lib/implementedProperties.js'), { encoding: 'utf-8', }); diff --git a/scripts/generate_properties.js b/scripts/generate_properties.js index 33a42728..1298d28e 100644 --- a/scripts/generate_properties.js +++ b/scripts/generate_properties.js @@ -255,6 +255,10 @@ parsedFiles.forEach(function(file) { var propertyDefinitions = []; parsedFiles.forEach(function(file) { var dashed = camelToDashed(file.property); + var isVendorSpecific = /^(o|moz|ms|webkit)-/.test(dashed); + if (isVendorSpecific) { + dashed = '-' + dashed; + } propertyDefinitions.push( t.objectProperty( t.identifier(file.property),