jsdom / cssstyle

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

Wrong behavior when setting `max-width` property on element #117

Open jiangying000 opened 4 years ago

jiangying000 commented 4 years ago

This is related to https://github.com/jsdom/jsdom/issues/3000

const { JSDOM } = require("jsdom");
const el = new JSDOM().window.document.createElement('div')
el.style.maxWidth = 0
el.style.width = 0
//  log '0 0px'
console.log(el.style.maxWidth, el.style.width) 

// should log '0px 0px' as browser does