Skip to content

"webkit-*" vs "-webkit-*" #70

@mcjazzyfunky

Description

@mcjazzyfunky

It seems there's a problem with the webkit prefixes (leading "-").
I think it should be -webkit-transform, not webkit-transform.

The following code shows the issue:

const
  cssstyle = require('cssstyle'),
  style = new cssstyle.CSSStyleDeclaration();

style.cssText = 'background-color: red; -webkit-transform: scale(2);'

// Be aware: Using "-webkit-transform" with leading "-"
console.log('background-color: ' + style.backgroundColor)  // working => "red"
console.log('-webkit-transform: ' + style.webkitTransform) // not working => "" <---------- !!!!


// Be aware: Using "webkit-transform" now, without leading "-"
style.cssText = 'background-color: green; webkit-transform: scale(3);'

console.log('background-color: ' + style.backgroundColor)  // working => "green"
console.log('webkit-transform: ' + style.webkitTransform) // working => "scale(3)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions