{"action":"created","issue":{"url":"https://api.github.com/repos/jquery/PEP/issues/274","repository_url":"https://api.github.com/repos/jquery/PEP","labels_url":"https://api.github.com/repos/jquery/PEP/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/jquery/PEP/issues/274/comments","events_url":"https://api.github.com/repos/jquery/PEP/issues/274/events","html_url":"https://github.com/jquery/PEP/pull/274","id":137834797,"number":274,"title":"[WIP] Dispatcher: Handle nested pointerenter/leave","user":{"login":"bethge","id":522575,"avatar_url":"https://avatars.githubusercontent.com/u/522575?v=3","gravatar_id":"","url":"https://api.github.com/users/bethge","html_url":"https://github.com/bethge","followers_url":"https://api.github.com/users/bethge/followers","following_url":"https://api.github.com/users/bethge/following{/other_user}","gists_url":"https://api.github.com/users/bethge/gists{/gist_id}","starred_url":"https://api.github.com/users/bethge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bethge/subscriptions","organizations_url":"https://api.github.com/users/bethge/orgs","repos_url":"https://api.github.com/users/bethge/repos","events_url":"https://api.github.com/users/bethge/events{/privacy}","received_events_url":"https://api.github.com/users/bethge/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jquery/PEP/labels/CLA:%20Valid","name":"CLA: Valid","color":"007700"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-02T10:29:56Z","updated_at":"2016-03-31T13:20:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jquery/PEP/pulls/274","html_url":"https://github.com/jquery/PEP/pull/274","diff_url":"https://github.com/jquery/PEP/pull/274.diff","patch_url":"https://github.com/jquery/PEP/pull/274.patch"},"body":"This PR tackles the issues pointed out in https://github.com/jquery/PEP/issues/197.\r\n\r\nFor visually overlapping elements, `pointerenter` and `pointerleave` events should propagate (but not bubble), analog to the way it works for mouse events: https://www.w3.org/TR/uievents/#figure-mouse-event-stacked-elements.\r\n\r\nAs @dmethvin describes,  `pointerenter` and `pointerleave` currently only fire on the original target of the event.\r\n\r\nIiuc, we listen on `document` for mouse events to bubble all the way up. Since `mouseenter` and `mouseleave` do not bubble, they never reach `document` and we will never _hear_ them. Thus we create `pointerenter` and `pointerleave` based on `mouseover` and `mouseout`, respectively.\r\n\r\nI put this on WIP, because I haven't had the chance to test it on touch devices and Linux. I intend to get to that by next week. Also, does anyone have other ideas on how to approach this?"},"comment":{"url":"https://api.github.com/repos/jquery/PEP/issues/comments/203933475","html_url":"https://github.com/jquery/PEP/pull/274#issuecomment-203933475","issue_url":"https://api.github.com/repos/jquery/PEP/issues/274","id":203933475,"user":{"login":"bethge","id":522575,"avatar_url":"https://avatars.githubusercontent.com/u/522575?v=3","gravatar_id":"","url":"https://api.github.com/users/bethge","html_url":"https://github.com/bethge","followers_url":"https://api.github.com/users/bethge/followers","following_url":"https://api.github.com/users/bethge/following{/other_user}","gists_url":"https://api.github.com/users/bethge/gists{/gist_id}","starred_url":"https://api.github.com/users/bethge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bethge/subscriptions","organizations_url":"https://api.github.com/users/bethge/orgs","repos_url":"https://api.github.com/users/bethge/repos","events_url":"https://api.github.com/users/bethge/events{/privacy}","received_events_url":"https://api.github.com/users/bethge/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T13:20:34Z","updated_at":"2016-03-31T13:20:34Z","body":"Apologies for the holdup.\r\n\r\nI missed that whenever a `touchstart`, `touchend` or `touchcancel` occurs, `pointerenter` and `pointerleave` events should propagate through the DOM to the target node.\r\n\r\nFrom [the spec][1], I take that a `touchcancel` triggers a `pointerleave` on each node from the target of `touchcancel` to the `html` node.\r\n\r\nI feel like functional tests for this kind of PR would be quite handy, but I haven't looked into that yet.\r\n\r\nP.S.: An easy way to trigger a `touchcancel` is rotating the device while touching an element.\r\n\r\n[1]: https://www.w3.org/TR/pointerevents/#the-pointercancel-event"}}