diff --git a/tests/pointerevent.html b/tests/pointerevent.html index 0595928d..2c705b33 100644 --- a/tests/pointerevent.html +++ b/tests/pointerevent.html @@ -63,8 +63,7 @@
OVERALL HASH

POINTER

-
TOUCH

-

+
TOUCH



maxTouchPoints

touch properties

touch keys



@@ -79,7 +78,7 @@ // https://bugzilla.mozilla.org/show_bug.cgi?id=1363508 let padlen = 18 -let oData = {} // pointer +let oData = {'pointerdown': {}, 'pointerover': {}} let oTouch = {} // touch! doh!! let oHash = { 'pointer': '', @@ -94,7 +93,7 @@ function finish() { if (0 == Object.keys(oData['pointerdown']).length) {return} if (0 == Object.keys(oData['pointerover']).length) {return} - if (oHash['touch_keys'] !== 'none' && 0 == Object.keys(oData['touchstart']).length) {return} + if (oHash['touch_keys'] !== 'none' && 0 == Object.keys(oTouch).length) {return} // yay let hash = mini(oHash) dom.hash = hash @@ -103,7 +102,6 @@ console.log('touch\n', oTouch) } - function runtouch(event, type) { // return if we already captured it if (0 !== Object.keys(oTouch).length) {return} @@ -134,15 +132,14 @@ } oTemp[k] = value }) - // merge + // screen matches client let matchX = false, matchY = false let A = oTemp['clientX'], B = oTemp['screenX'] - if ('number' == A && 'number' == B) {matchX = A == B} + if ('number' == typeof A && 'number' == typeof B) {matchX = A === B} oTouch['client_screenX'] = matchX oDisplay.push(s6 + ('client|screen X').padStart(padlen) +": "+ sc + A +' | '+ B +' '+ (matchX ? '[valid match]' : '[!match]')) - let C = oTemp['clientY'], D = oTemp['screenY'] - if ('number' == C && 'number' == D) {matchY = C == D} + if ('number' == typeof C && 'number' == typeof D) {matchY = C === D} oTouch['client_screenY'] = matchY oDisplay.push(s6 + ('client|screen Y').padStart(padlen) +": "+ sc + C +' | '+ D +' '+ (matchY ? '[valid match]' : '[!match]')) @@ -154,10 +151,11 @@ }) dom.touch.innerHTML = oDisplay.join("
") + '

' let hash = mini(oTouch) + oHash['touch'] = hash dom.touchhash = hash finish() } catch(e) { - dom.touch.innerHTML = e+'' + dom.touch.innerHTML = e+'
' } }