-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add tests for invalid style inputs #553
Comments
I like this! Unfortunately the NonNegativef32 types and friends are a pain to work with for users; I think we should avoid them in our API. That said, I'd be fully on-board for adding a ton of debug asserts to check for invalid data like this as well. Users can disable them for their code by building taffy itself in release mode. |
Yeah, agreed.
I think my ideal is something like |
Okay, I'm on board with that :) Definitely want something for the whole tree too; libraries will want to be able to expose this. |
What problem does this solve or what need does it fill?
Some style properties accept values that aren't actually valid for that property. The most notable cases being properties that accept
f32
but where only non-negative finite values are valid.What solution would you like?
What alternative(s) have you considered?
NonNegativeF32
. However, this seems like it might be a pain for consumers of the API who will have to push values through a conversion step every time they want to set a style.Additional context
We can't easily cover these cases with gentests as the browser will discard the styles before they even get to the
The text was updated successfully, but these errors were encountered: