Skip to content

Commit 4c44fb7

Browse files
committed
cleanup check for sourceCapabilities
1 parent ed4c18a commit 4c44fb7

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/standard/gestures.html

+7-11
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,19 @@
4141
// Check for touch-only devices
4242
var IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);
4343

44-
// Check for sourceCapabilities, used to distinguish synthetic events
45-
var HAS_SOURCE_CAPS = 'sourceCapabilities' in UIEvent.prototype;
46-
4744
// touch will make synthetic mouse events
4845
// `preventDefault` on touchend will cancel them,
4946
// but this breaks `<input>` focus and link clicks
5047
// disable mouse handlers for MOUSE_TIMEOUT ms after
5148
// a touchend to ignore synthetic mouse events
5249
var mouseCanceller = function(mouseEvent) {
53-
if (HAS_SOURCE_CAPS) {
54-
// if mouseEvent did not come from a device that fires touch events,
55-
// it was made by a real mouse and should be counted
56-
// http://wicg.github.io/InputDeviceCapabilities/#dom-inputdevicecapabilities-firestouchevents
57-
var sc = mouseEvent.sourceCapabilities;
58-
if (sc && !sc.firesTouchEvents) {
59-
return;
60-
}
50+
// Check for sourceCapabilities, used to distinguish synthetic events
51+
// if mouseEvent did not come from a device that fires touch events,
52+
// it was made by a real mouse and should be counted
53+
// http://wicg.github.io/InputDeviceCapabilities/#dom-inputdevicecapabilities-firestouchevents
54+
var sc = mouseEvent.sourceCapabilities;
55+
if (sc && !sc.firesTouchEvents) {
56+
return;
6157
}
6258
// skip synthetic mouse events
6359
mouseEvent[HANDLED_OBJ] = {skip: true};

0 commit comments

Comments
 (0)