W3C home > Mailing lists > Public > public-pointer-events@w3.org > January to March 2016

[pointerevents] Issue with compatibility mouse events and inconsistency with mouse pointerevent

From: Navid Zolghadr via GitHub <sysbot+gh@w3.org>
Date: Tue, 23 Feb 2016 20:40:07 +0000
To: public-pointer-events@w3.org
Message-ID: <issues.opened-135857393-1456260003-sysbot+gh@w3.org>
navidzolghadr has just created a new issue for 
https://github.com/w3c/pointerevents:

== Issue with compatibility mouse events and inconsistency with mouse 
pointerevent  ==
@RByers @mustaqahmed 

Looking at this example:

https://output.jsbin.com/bupaluf

Step 1. Move the mouse on the green box and leave it there.
Step 2. Touch the blue box and release.
Step 3. Now slightly move the mouse.

Here is the sequence in case it is hard to test it on Edge:

---- Step 1 ----
pointerover (id=1) on green 
mouseover on green 
pointerenter (id=1) on green 
mouseenter on green 
---- Step 2 ----
mouseout on green 
pointerleave (id=134) on green 
mouseleave on green 
pointerover (id=134) on blue 
mouseover on blue 
pointerenter (id=134) on blue 
mouseenter on blue 
pointerout (id=134) on blue 
mouseout on blue 
pointerleave (id=134) on blue 
mouseleave on blue 
---- Step 3 ----
mouseover on green 
pointerenter (id=1) on green 
mouseenter on green 


This sequence of events seem incorrect to me. Particularly looking at 
pointerevent with id=1 you can see the inconsistent sequence of events
 for it (i.e. 2 enters for green). Also mouse events (that are 
actually fired by moving mouse device) do no fully match the 
pointerevents with id=1 (i.e. the last 3 events).

The problem I see here is not quite addressed in the spec either. So I
 was wondering if something is missing or I have misunderstood 
something. 

If there is actually a problem here, I can imagine the following 
solutions (which the first one looks cleaner to me but I don't know 
the impact).

1. Do not try to match pointerevents with mouse events at all. So 
basically we left mouse in the green box and we touched blue box and 
fired compatibility mouse events for the touch event. Now if we move 
the mouse since the pointerevent with id=1 is still in the green box 
we shouldn't send any transition events (i.e. pointerenter/over) 
however since the mouse (i.e. the compatibility mouse which might 
include the actual mouse, touch, or pen) is in the blue box we should 
now send the mouse transition events to both blue box (mouseout/leave)
 and green box (mouseover/enter). This solution breaks the consistency
 of pointerevent with id=1 with mouse events but tells a consistent 
story looking only at pointer events or only looking at the mouse 
events.

2. The second solution is when we touch somewhere and we fire 
compatibility mouse event we really move the mouse to there. So 
basically not only send the pointerevents with id=#RandomNumber for 
the touch event itself but also send the pointerevents with id=1 for 
the mouse. This solution makes sure the consistency of pointerevent 
with id=1 and the mouse events but in the cases like pen or touch 
events sends double pointer events which might not be desirable.

I was wondering what exactly Edge does as I couldn't quite figure out 
from the sequence of events. It is definitely neither of what I said.

Please view or discuss this issue at 
https://github.com/w3c/pointerevents/issues/35 using your GitHub 
account
Received on Tuesday, 23 February 2016 20:40:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 23 February 2016 20:40:11 UTC