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

[BUG] PointerEvent float properties #105

Open
rickyvetter opened this issue Oct 11, 2024 · 1 comment
Open

[BUG] PointerEvent float properties #105

rickyvetter opened this issue Oct 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@rickyvetter
Copy link
Contributor

rickyvetter commented Oct 11, 2024

In practice all of the positional properties (clientX/Y, etc) on pointerEvents are floats, not ints (at least in latest Chrome). In the Dom_html they inherit from mouseEvent, which describes all of these values as ints. In wasm this fails with a cast error (and in javacript obviously there is a loss of precision in the number).

I think the right fix is to update the types, ideally before the float/int breaking change in js_of_ocaml so that folks can migrate both at the same time. Maybe a closer audit of these values would be good to ensure we aren't missing more?

@rickyvetter rickyvetter added the bug Something isn't working label Oct 11, 2024
@vouillon
Copy link
Collaborator

Indeed, the type of these MouseEvent properties has been changed from int to float.
https://www.w3.org/TR/cssom-view-1/#extensions-to-the-mouseevent-interface

That would not be a bad thing to audit and modernize the Js_of_ocaml library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants