Skip to content

Conversation

@lightman76
Copy link
Contributor

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.

…dded 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.
Copy link
Owner

@NV NV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your patch!

Please fix coding style issues and it's good to be merged.

lib/parse.js Outdated

var index;
var buffer = "";
var valueParenthesisDepth=0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces around =.

lib/parse.js Outdated
// ie css expression mode
if (buffer.trim() === 'expression') {
var info = (new CSSOM.CSSValueExpression(token, i)).parse();
var info = (new CSSOM.CSSValueExpression(token, i)).parse();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use tabs for indentation.

lib/parse.js Outdated
if (state === 'value-parenthesis') {
state = 'value';
valueParenthesisDepth--;
if(valueParenthesisDepth === 0) state = 'value';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after if.

@lightman76
Copy link
Contributor Author

Ok - made the requested changes. Thanks!

@lightman76
Copy link
Contributor Author

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

…- the else if check that increased the valueParenthsisDepth was part of the wrong if block.
@lightman76
Copy link
Contributor Author

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.

@NV NV merged commit d93592f into NV:gh-pages Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants