Bug 1250691 - [Devtools][Responsive mode] The "touchend" event should not have the removed touch. r=jryans

This commit is contained in:
Julien Wajsberg 2016-02-26 09:40:00 -05:00
parent b9a9010687
commit 8832806e81
2 changed files with 10 additions and 1 deletions

View File

@ -33,6 +33,8 @@
}, true);
div.addEventListener("touchend", function(evt) {
div.style.transform = "none";
if (!evt.touches.length) {
div.style.transform = "none";
}
}, true);
</script>

View File

@ -284,9 +284,16 @@ var simulator = {
evt.screenX, evt.screenY,
evt.clientX, evt.clientY,
1, 1, 0, 0);
let touches = document.createTouchList(point);
let targetTouches = touches;
let changedTouches = touches;
if (name === "touchend" || name === "touchcancel") {
// "touchend" and "touchcancel" events should not have the removed touch
// neither in touches nor in targetTouches
touches = targetTouches = document.createTouchList();
}
touchEvent.initTouchEvent(name, true, true, content, 0,
false, false, false, false,
touches, targetTouches, changedTouches);