Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Stop trying to check screenX/Y values

No good way to validate these.  Not worth the complexity to try to do any checks at all.
  • Loading branch information...
commit 86d50fc931a97f408234e937c4d45d3fbb03ff6d 1 parent eef7fbd
@RByers RByers authored
Showing with 3 additions and 18 deletions.
  1. +3 −18 single-touch.html
View
21 single-touch.html
@@ -163,15 +163,6 @@
assert_equals(touch.clientX, touch.pageX - window.pageXOffset, "touch.clientX is touch.pageX - window.pageXOffset.");
assert_equals(touch.clientY, touch.pageY - window.pageYOffset, "touch.clientY is touch.pageY - window.pageYOffset.");
}
-
- function check_touch_screenXY(touch) {
- // We have no reliable way to convert screen co-ordinates to client co-ordinates (due to the unknown
- // size of any window chrome), but we can validate they're in a consistent region.
- assert_true(touch.screenX >= touch.clientX + window.screenX, "touch.screenX is at least touch.clientX + window.screenX.");
- assert_true(touch.screenX < window.screen.width, "touch.screenX is less than window.screen.width");
- assert_true(touch.screenY >= touch.clientY + window.screenY, "touch.screenY is at least touch.clientY + window.screenY.");
- assert_true(touch.screenY < window.screen.height, "touch.screenX is less than window.screen.width");
- }
function run() {
var target0 = document.getElementById("target0");
@@ -276,9 +267,9 @@
test(function() {
check_touch_clientXY(t);
}, "touchstart: touch clientX/clientY is consistent with pageX/pageY");
- test(function() {
- check_touch_screenXY(t);
- }, "touchstart: touch screenX/screenY is consistent with clientX/clientY");
+ // Note we don't bother testing screenX/screenY values - there's no reliable way to
+ // verify they are consistent with clientX/clientY (due to unknown amount of window
+ // chrome), and also various forms of scaling mean they are in different units.
});
on_event(target0, "touchmove", function onTouchMove(ev) {
@@ -324,9 +315,6 @@
test(function() {
check_touch_clientXY(tt);
}, "touchmove: touch clientX/clientY is consistent with pageX/pageY");
- test(function() {
- check_touch_screenXY(tt);
- }, "touchmove: touch screenX/screenY is consistent with clientX/clientY");
});
@@ -369,9 +357,6 @@
test(function() {
check_touch_clientXY(t);
}, "touchend: touch clientX/clientY is consistent with pageX/pageY");
- test(function() {
- check_touch_screenXY(t);
- }, "touchend: touch screenX/screenY is consistent with clientX/clientY");
done();
});

0 comments on commit 86d50fc

Please sign in to comment.
Something went wrong with that request. Please try again.