You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
Create tests for these cases.
Ensure that Taffy's algorithms are correctly discarding these styles and using the default value for the style property in their place.
What alternative(s) have you considered?
Create restricted types like 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:
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.
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.
Yeah, agreed.
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.
I think my ideal is something like .lint() method on Style that returns something like a Vec<StyleWarning> describing any issues, and could be used either for logging warnings, creating hard errors, or implementing something akin to browser dev tools. And perhaps something similar for a whole tree?
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: