NV / CSSOM

Unmaintained! ⚠️ CSS Object Model implemented in pure JavaScript. Also, a CSS parser.
https://nv.github.io/CSSOM/docs/parse.html
MIT License
751 stars 99 forks source link

Added fix for handling of spaces within parenthesis in values. #87

Closed lightman76 closed 7 years ago

lightman76 commented 7 years ago

Also added handling of nested parenthesis in a value so that it doesn't leave the value-parenthesis state until all open parenthesis are matched with a close.

Added a test for the case I ran across this problem where I had a linear-gradient with an RGBA value for the second transition point, but transparent for the first. The space was dropped after the transparent, but not the rgba value because the closing paren of the RGBA value transitioned back into the value state from value-parenthesis.

This should resolve #86 also - I just added a test case for that to my PR.

lightman76 commented 7 years ago

Ok - made the requested changes. Thanks!

lightman76 commented 7 years ago

whoops -just realized I made the changes in the wrong branch. Will have those submitted in just a minute.

lightman76 commented 7 years ago

Ok - I've got that up now. I also fixed a bug in my original PR - the else if block that incremented the valueParenthesisDepth was in the wrong if - it was inside the block for state === 'value'.

Let me know if you want me to squash these commits.