jsdom / cssstyle

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

Improve handling of padding and margin #35

Closed dpvc closed 8 years ago

dpvc commented 8 years ago

This pull request improves the handling of padding and margin. They now set and clear the -top, -right, -bottom, and -left properties properly, and validate the value they are set to. It also adds some tests to verify that this works.

As part of the update, the implicitSetter() function is simplified, and made more efficient (the parser function is only called once on any of the parts). Also, unneeded empty parts are not retained in the _values array. Finally, getParts() now allows multiple spaces as separators.

chad3814 commented 8 years ago

Awesome, I'll review this in the morning CST and then merge and push a new version to npm