-
Notifications
You must be signed in to change notification settings - Fork 142
[css-typed-om-1] "equal numeric values" may return false when people might expect true #682
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
Comments
Yeah it will currently return false. There are many definitions of "equal" that we can go with here (some easy, some intractable). I think we should just pick one that's not too opinionated and allow the user to define fancier equalities as they desire by traversing the tree. Some ideas:
IMHO 3 is difficult to get right. I'm ok with either 1 or 2. Can we take inspiration from another spec or maybe JavaScript itself? |
Fwiw, I agree that 3 is difficult to get right. Right now I think the spec is aiming for 2. |
Closing because the spec now clearly specifies 1. |
I think it would help if you add an example of things seeming equal not being equal. |
Thanks! |
Consider the output of https://drafts.css-houdini.org/css-typed-om-1/#equal-numeric-value on these two values:
I believe you can produce those data structures, and that this algorithm will return false in this case, right?
I'm not sure I have a nice suggestion here, by the way; solving this in general is not trivial.
The text was updated successfully, but these errors were encountered: