Re: [touch-events] Spec should be explicit on whether the order of elements in TouchLists is relevant

revisiting this, as it's been bugging me...before i go off an propose a PR, here's what i plan to add. due to the fact that it does indeed seem that there's some inconsistency in existing implementations, like in Firefox, i'd propose adding these as normative statements (but i'll work on some cleaner wording, this is just to get the concepts down):

- the touches in the touchlist SHOULD be in the order in which touches were added
- once a touch is on the screen, its position/index in the touchlists, as well as its `identifier`, SHOULD remain the same, as long as no further touches are added/removed (in which case all bets are off, since even just to make sure there's no gaps things may need to be reshuffled); additionally, add a non-normative note that says that authors are advised to rely on `identifier`
- the touchlists MUST not be "sparse arrays" (can we call these "arrays"? is there an equivalent/better way, like  "sparse collection" or similar?) - when a touch is removed, subsequent touches in the touchlist are "bumped" to fill the gap. however, there's no guarantee that after a touch has been removed that the relative order of the touches is the same
- when a touch is added, it SHOULD be added at the end of the touchlist (but from testing, this is where on Android things get funky, as it seems to somehow "remember" the previous position of a touch that was removed and then re-added?)

in short, the only MUST is that there be no gaps in touchlists. the SHOULDs reflect most sane current behavior. non-normative note reinforces that authors should rely on `identifier`.

thoughts?

-- 
GitHub Notification of comment by patrickhlauke
Please view or discuss this issue at https://github.com/w3c/touch-events/issues/13#issuecomment-294447979 using your GitHub account

Received on Monday, 17 April 2017 10:38:35 UTC