New issue
Advanced search Search tips

Issue 607948 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug

Blocked on:
issue 655786

Blocking:
issue 540840
issue 456625



Sign in to add a comment

PointerEvent should have fractional coordinates

Project Member Reported by mustaq@chromium.org, Apr 29 2016

Issue description

Looks like we would want this sooner: Edge fires PEs with fractional coordinates but MEs still with integers. There might be some compat implications with MEs, but not for PEs.

We should follow Edge at least.

Implementation wise, fixing  Issue 456625  first makes sense, although hiding ME fractional coordinates from JS is a possibility if there is a compat issue.

 

Comment 1 by mustaq@chromium.org, Apr 29 2016

Components: Blink>Input
Labels: -OS-Linux Hotlist-Input-Dev OS-All

Comment 2 by mustaq@chromium.org, Jun 29 2016

Labels: PointerEvent
Owner: mustaq@chromium.org
Status: Assigned (was: Available)
We're reporting integer co-ordinate for both touch and mouse, right?  Touch is probably the high-priority case (don't want switching from TE to PE to regress behavior at all).  So I suggest inverting the blocking relationship with  issue 456625 .  

I.e. first upgrade MouseEvent (and hence PointerEvent) co-ordinates to be capable of including fractions, but continue to report integers for the WebMouseEvent case.  That should be pretty easy to do and get most of the value (but probably requires an intent since the behavior is web exposed due to events synthesized in JS).

Later (perhaps post PE-ship) you can upgrade all the WebMouseEvent plumbing to also support fractional co-ordinates for mouse devices ( issue 456625 ).

WDYT?
Blockedon: -456625
Blocking: 456625
Right, a partial fix for  crbug.com/456625  unblocks this bug. Since the bigger fix for  crbug.com/456625  (WebMouseEvent plumbing) should follow this bug, I have inverted the blocking dependency.
 Issue 649221  has been merged into this issue.

Comment 6 by mustaq@chromium.org, Sep 26 2016

Summary: PointerEvent should have fractional coordinates (was: PointerEvent should have fractional coordinates?)
The PEWG had reached consensus a while back:
https://github.com/w3c/pointerevents/issues/107

Comment 7 by rbyers@chromium.org, Sep 29 2016

Labels: -Pri-3 M-55 Pri-1
As discussed in #3, exposing fractional values for touch is probably urgent.  Otherwise switching from touch events to pointer events can be a regression in user experience (smooth dragging, line writing, etc.)
Status: Started (was: Assigned)
Labels: ReleaseBlock-Stable
Observed one weirdness in Edge: even though it emits fractional clientX/Y for touches, the console seems to truncate clientX/Y to int even with a pointerType="touch" property.
  new PointerEvent('eventType', { clientX: 123.45 }).clientX;   =>   123
Fascinating.  Even a more realistic event like:
var e = new PointerEvent('pointerdown', {
  pointerType:"touch",
  clientX:10.5,
  clientY:10.5
});

Doesn't get fractional co-ordinates.  Can you reach out to Ted to see if he can explain when you will and will not see fractional co-ordinates?  I don't think this needs to block us though.
I do see some fractional values for pageX/pageY though but not the ones I input (maybe they're getting computed from the clientX/clientY values)!  See http://jsbin.com/hiraqow/1
Labels: -M-55 M-56
Since shipping fractional PE coordinates w/o affecting ME coordinates seems hard, and my patch to even minimally change ME calls for an intent to ship (see https://codereview.chromium.org/2406263003/#ps160001), we will fix it in M56 instead.
Blockedon: 655786
Labels: TE-NeedsTriageHelp
Project Member

Comment 16 by bugdroid1@chromium.org, Nov 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/48a106897274196b5897f1b0967d28c49e4ec696

commit 48a106897274196b5897f1b0967d28c49e4ec696
Author: mustaq <mustaq@chromium.org>
Date: Wed Nov 16 13:45:45 2016

Make PointerEvent coordinates fractional for touch

The current PointerEvent spec doesn't override the UI
MouseEvent spec definition of (clientX, clientY) and
(screenX, screenY) coordinates: all of them are integers.
This is not great for the sites that currently use Touch
Events & trying to switch to Pointer Events for touch:
specially on high DPI devices Pointer Event coordinates
would feel less precise than fractional Touch Event
coodinates. The PEWG has already reached consensus that
all coordinates in Pointer Events should be floating
point values:
  https://github.com/w3c/pointerevents/issues/107

Edge already reports fractional client coordinates for
PointerEvents (and not MouseEvents).

This CL exposes fractional Pointer Event coordinates for
touch input. Although the CL changes the client & screen
coordinates in Mouse Event idl to floating points, the
integer plumbing for mouse is kept intact so that mouse
coordinates still appear unchanged to JS. Pointer Events
that are fired for touches propagate appropriate
fractional coordinates to JS.

Intent to Implement and Ship: https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/1kroHAnh3BU/uYZb6uZRBwAJ

BUG= 607948 

Review-Url: https://codereview.chromium.org/2406263003
Cr-Commit-Position: refs/heads/master@{#432473}

[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/LayoutTests/fast/events/constructors/mouse-event-constructor-expected.txt
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/LayoutTests/fast/events/constructors/mouse-event-constructor.html
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor-expected.txt
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor.html
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor-expected.txt
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor.html
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-events-expected.txt
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-events.html
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/core/events/MouseEvent.cpp
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/core/events/MouseEvent.idl
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/core/events/MouseEventInit.idl
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/core/events/MouseRelatedEvent.h
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/core/html/forms/RangeInputType.cpp
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/core/html/shadow/SliderThumbElement.cpp
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/core/page/ContextMenuController.cpp
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/web/WebInputEventConversion.cpp
[modify] https://crrev.com/48a106897274196b5897f1b0967d28c49e4ec696/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Status: Fixed (was: Started)
Blocking: 540840

Sign in to add a comment