-
Notifications
You must be signed in to change notification settings - Fork 3
Replace Rust CSS transform parser with C/C++ implementation supporting negative values #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: yorkie <1935767+yorkie@users.noreply.github.com>
Co-authored-by: yorkie <1935767+yorkie@users.noreply.github.com>
Co-authored-by: yorkie <1935767+yorkie@users.noreply.github.com>
Co-authored-by: yorkie <1935767+yorkie@users.noreply.github.com>
Co-authored-by: yorkie <1935767+yorkie@users.noreply.github.com>
yorkie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert your changes on build directory.
Co-authored-by: yorkie <1935767+yorkie@users.noreply.github.com>
Done! I've reverted all the build directory changes - restored the .gitignore to its original state and brought back all the build artifacts that were previously committed. (8a02794) |
yorkie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't submit the changes of the build directory.
Co-authored-by: yorkie <1935767+yorkie@users.noreply.github.com>
Removed all CMake build artifacts from git tracking and updated .gitignore to prevent CMake-generated files from being committed in the future. The build directory now only contains the original build scripts and configuration files as intended. (b150a2b) |
This PR replaces the existing Rust-based CSS transform parser with a comprehensive C++ implementation that integrates with the existing CSS value tokenizer infrastructure and adds support for negative values.
Key Changes
New C++ Transform Parser
css_transform_parser.{hpp,cpp}supporting all CSS transform functionsCSSValueTokenizerfor robust CSS value parsingtranslate(),translateX(),translateY(),translateZ(),translate3d()rotate(),rotateX(),rotateY(),rotateZ(),rotate3d()scale(),scaleX(),scaleY(),scaleZ(),scale3d()matrix(),matrix3d()skew(),skewX(),skewY()perspective()nonekeywordNegative Value Support
The parser now correctly handles negative values as required by the CSS specification:
The implementation works around tokenizer behavior where negative dimensions are parsed as identifier tokens rather than separate delimiter + dimension tokens, ensuring robust parsing of all negative value formats.
Dependency Removal
crates::css2::parsing::parseTransform()Comprehensive Testing
Added 47+ test cases covering all transform functions and edge cases including extensive negative value testing to ensure correctness and CSS specification compliance.
Benefits
Fixes #175.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.