jsdom / cssstyle

A Node.js implementation of the CSS Object Model CSSStyleDeclaration interface
MIT License
109 stars 70 forks source link

font-size not covered by the parse function and can set with invalid values #90

Closed omriLugasi closed 5 years ago

omriLugasi commented 5 years ago

According to this issue in jsDOM i figure out that the bug is in the cssStyleDeclertion

The bug happen because we don't use the parse function to check if the font-size is invalid

For example:


    var style = new cssstyle.CSSStyleDeclaration();
    style.cssText = 'font-size: 15px'
    style.length // equal 1
    style.cssText = 'font-size: 1r5px'
    style.length // equal 1 (should be 0 because the value [1r5px] is invalid)

I already open pull request that solve this issue.

jsakas commented 5 years ago

Closed by https://github.com/jsakas/CSSStyleDeclaration/pull/91