Bug 1366783 Loosen responsive design mode test check for 300ms touch delay. r=jryans

This commit is contained in:
Ben Kelly 2017-05-23 07:30:55 -07:00
Родитель 8382efc2b2
Коммит d0da707a64
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -71,7 +71,10 @@
div.addEventListener("mousedown", function (evt) {
if (previousEvent === "touchend" && touchendTime !== 0) {
let now = performance.now();
div.dataset.isDelay = ((now - touchendTime) >= 300);
// Do to time spent processing events our measurement might
// be fractionally short of the actual delay. Round up any
// microsecond changes in case we get something like 299.9.
div.dataset.isDelay = ((now - touchendTime) >= 299.5);
} else {
div.dataset.isDelay = false;
}

Просмотреть файл

@ -70,7 +70,10 @@
div.addEventListener("mousedown", function(evt){
if (previousEvent === "touchend" && touchendTime !== 0) {
let now = performance.now();
div.dataset.isDelay = ((now - touchendTime) >= 300) ? true : false;
// Do to time spent processing events our measurement might
// be fractionally short of the actual delay. Round up any
// microsecond changes in case we get something like 299.9.
div.dataset.isDelay = ((now - touchendTime) >= 299.5) ? true : false;
} else {
div.dataset.isDelay = false;
}