Skip to content
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

Fix UnknownProperty being used for known properties #152

Merged
merged 1 commit into from
May 29, 2023

Conversation

lee-m
Copy link
Contributor

@lee-m lee-m commented May 22, 2023

If the parser options IncludeUnknownDeclarations or AllowInvalidValues are set to true, StylesheetComposer will incorrectly use UnknownProperty for everything, even when the property name in question is a known one.

Fixed by first trying to create the property with the specified name and only falling back to UnknownProperty if the created property is null and one of IncludeUnknownDeclarations or AllowInvalidValues are set.

The new test case is an example of something that was failing without this fix - despite border-width being a known property name, the parsed output would have this as an UnknownProperty in the child list.

If the parser options IncludeUnknownDeclarations or AllowInvalidValues are set to true, StylesheetComposer will incorrectly use UnknownProperty for everything, even when the property name in question is a known one.

Fix by first trying to create the property with the specified name and only falling back to UnknownProperty if the created property is null and one of IncludeUnknownDeclarations  or AllowInvalidValues are set.
@TylerBrinks TylerBrinks merged commit 363b951 into TylerBrinks:master May 29, 2023
@lee-m lee-m deleted the unknown-prop branch May 29, 2023 16:01
H1Gdev added a commit to H1Gdev/SVG that referenced this pull request Sep 6, 2023
mrbean-bremen pushed a commit to svg-net/SVG that referenced this pull request Sep 8, 2023
github-actions bot pushed a commit to svg-net/SVG that referenced this pull request Sep 8, 2023
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