-
Notifications
You must be signed in to change notification settings - Fork 33
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
PointerEvents should have fractional coordinates #107
Comments
+1 for all fractional values |
i'd be for changing those to |
I agree with changing them to float for consistency reasons. I am not overly concerned about compat risks since we have had fractional values for those devices that support it for On the other hand, we are fairly sure that the underlying system does not provide fractional values for What's happening is that For |
I'm in favor of making everything (including screenX/Y) float where feasible, for the simple reason that it's easy to always provide int values even if the type is spec'd as float, but not so the other way around. Also for example on some Firefox OS devices we had hardware actually reporting subpixel-valued touch events, and if we ever want to expose that level of precision to content then it makes sense to have floats instead of ints. |
Discussed in the hackathon that Edge's behavior with |
Note that CSS OM View already updates MouseEvent to define the co-ordinates as fractional. Once implementations have aligned on this, I'm sure we can get it moved into the UI Events spec. If, for web compat, we have to say that Let's leave this issue open to remind ourselves to get the right spec updates for this. I'm guessing it's probably not practical to write web-platform-tests for this (until we have #120), right? |
In our call today I said I'd file a bug on UI Events to adopt the In Chrome, In Edge, even So let's wait until we've got at least these implementation issues addressed and behaving consistently between Edge and Chrome before we push to adopt the IDL change into the UI Events spec. WebKit and Gecko still use |
Looks like we can partially test fractional coordinates even without #120 , through trivial changes in the web-platform-test pointerevent_constructor.html. @RByers: Do you think it's a reasonable thing to do even without a change in spec wording? I am assuming that PointerEvents can be inferred to be based on the MouseEvent overrides in CSS OM View spec. |
Yes, I think we should just test this here. Ideally the the CSS OM View spec would have tests for fractional values passed to MouseEvent constructors (maybe it does already @zcorpan?). But regardless I thin it's fine to just update We should probably also be pushing for the OM View MouseEvent changes to be merged back into the UI Events spec now that there are at least 2 shipping implementations /cc @garykac. |
Note that testing that fractional co-ordinates get passed through the constructor isn't quite the same thing as testing real browser-generated events. So ideally we'd also use our automation hooks to test that too. But rather than create but-yet more -manual tests, I think it's fine to just block that on #120 (which is hopefully happening soonish - at least for Chrome). |
@RByers (or anybody else) ... anything more on this than can/needs to be done? |
I believe it should now be possible to test this, but I'm not entirely up-to-date on the status. Maybe @NavidZ can take a look? |
The current automation API only allows an element as the target and not the exact coordinates. |
We already have a manual test for this usecase. I was going to use our click api but I realized it also expect the touch and pen inputs. I suggest waiting for this PR to land to have synthetic pointer action API and then directly use that instead for the automation. I'll keep an eye on the progress on that front and will take care of updating pointerevent tests accordingly. |
PointerEvent spec doesn't override the MouseEvent spec definition of
(clientX, clientY)
and(screenX, screenY)
coordinates: all of them are integers. In Edge, PointerEvents (and not MouseEvents) have fractional client coordinates even though screen coordinates are always integers.Chrome follows the spec but wants to follow Edge.
The text was updated successfully, but these errors were encountered: