W3C home > Mailing lists > Public > public-pointer-events@w3.org > April to June 2013

RE: Last Call comments

From: François REMY <francois.remy.dev@outlook.com>
Date: Tue, 9 Apr 2013 12:25:30 +0200
Message-ID: <DUB120-W26D2A9463B15470EB2B857A5C60@phx.gbl>
To: Konstantinov Sergey <twirl@yandex-team.ru>
CC: Pointer Events WG <public-pointer-events@w3.org>
> Sorry, nothing wrong.
> Map catches the pointerdown event and immediately sets the capture, because next pointermove event may already be out of the map element if user places the finger near the map edge. There may be not dragging, but some flick gesture where the situation when second event occurs outside of target element is common.

This has a probability of happening close to zero. When an user want to drag, it will never start near the end of the map close to the direction in which it want to drag to, it will start near the opposite edge or in the center, leaving plenty of free space in the direction of the flick. But, okay, let's say you want to solve even this use case.

I have had no problem using setPointerCapture and solving your marker/map issue, as can be seen here:

 map:start 
 marker:start 
 map:ignore 
 marker:ignore 
 0 
 -1 
 map:ignore 
 marker:ignore 
 1 
 -1 
 map:ignore 
 marker:ignore 
 3 
 -2 
 map:ignore 
 marker:ignore 
 4 
 -2 
 map:drag 
 6 
 -2 
 marker:abort 
 map:drag 
 8 
 -2 
 map:drag 
 11 
 -2 
 map:drag 
 13 
 -3 
 map:drag 
 16 
 -3 
 map:drag 
 19 
 -3 
 map:drag 
 26 
 -4 
 map:drag 
 33 
 -5 
 map:drag 
 35 
 -5 
 map:drag 
 36 
 -5 
 map:drag 
 39 
 -5 
 map:drag 
 41 
 -5 
 map:drag 
 43 
 -5 
 map:drag 
 44 
 -5 
 map:drag 
 45 
 -5 
 map:drag 
 47 
 -5 
 map:end 
 47 
 -5 

I think you try too hard to remove a useful feature when it's used correctly. You're just too used to your 'hook on the document' trick and you fail to notice it's not needed in a world where you can simply use pointer capture. Hooking events on the document is a bad idea and will not work properly in the case your map is included in an IFRAME, something which I believe has more chance to happen than the tricky slide from the edge you were afraid of.

Anyway, have a look at my code (sorry, I cooked it very quickly, the quality may not be perfect but I tried to put enough comments to make it easy to understand).

Best regards,
François

________________
PS: To be efficient, one should probably prevent the 'pointerdown' event to bubble to the ancestors of the map, because any gesture at an higher level than the map should never be triggered once the drag gesture did start. 		 	   		  

Received on Tuesday, 9 April 2013 10:26:04 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:20:25 UTC