third_party/polymer3/bower_components/polymer/lib/utils/gestures.js
function _add(node, evType, handler) {
  let recognizer = gestures[evType];
  let deps = recognizer.deps;
  let name = recognizer.name;
  let gobj = node[GESTURE_KEY];
  if (!gobj) {
    node[GESTURE_KEY] = gobj = {};
  }
  for (let i = 0, dep, gd; i < deps.length; i++) {
    dep = deps[i];
    // don't add mouse handlers on iOS because they cause gray selection overlays
    if (IS_TOUCH_ONLY && isMouseEvent(dep) && dep !== 'click') {
      continue;
    }
    gd = gobj[dep];
    if (!gd) {
      gobj[dep] = gd = {_count: 0};
    }
    if (gd._count === 0) {
      node.addEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));
    }
    gd[name] = (gd[name] || 0) + 1;
    gd._count = (gd._count || 0) + 1;
  }
  node.addEventListener(evType, handler);
  if (recognizer.touchAction) {
    setTouchAction(node, recognizer.touchAction);
  }
}
function _add(node, evType, handler) {
  let recognizer = gestures[evType];
  let deps = recognizer.deps;
  let name = recognizer.name;
  let gobj = node[GESTURE_KEY];
  if (!gobj) {
    node[GESTURE_KEY] = gobj = {};
  }
  for (let i = 0, dep, gd; i < deps.length; i++) {
    dep = deps[i];
    // don't add mouse handlers on iOS because they cause gray selection overlays
    if (IS_TOUCH_ONLY && isMouseEvent(dep) && dep !== 'click') {
      continue;
    }
    gd = gobj[dep];
    if (!gd) {
      gobj[dep] = gd = {_count: 0};
    }
    if (gd._count === 0) {
      node.addEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));
    }
    gd[name] = (gd[name] || 0) + 1;
    gd._count = (gd._count || 0) + 1;
  }
  node.addEventListener(evType, handler);
  if (recognizer.touchAction) {
    setTouchAction(node, recognizer.touchAction);
  }
}
function _add ( node , evType , handler ) { let recognizer = gestures [ evType ] ; let deps = recognizer . deps ; let name = recognizer . name ; let gobj = node [ GESTURE_KEY ] ; if ( ! gobj ) { node [ GESTURE_KEY ] = gobj = { } ; } for ( let i = 0 , dep , gd ; i < deps . length ; i ++ ) { dep = deps [ i ] ; // don't add mouse handlers on iOS because they cause gray selection overlays if ( IS_TOUCH_ONLY && isMouseEvent ( dep ) && dep !== 'click' ) { continue ; } gd = gobj [ dep ] ; if ( ! gd ) { gobj [ dep ] = gd = { _count : 0 } ; } if ( gd . _count === 0 ) { node . addEventListener ( dep , _handleNative , PASSIVE_TOUCH ( dep ) ) ; } gd [ name ] = ( gd [ name ] || 0 ) + 1 ; gd . _count = ( gd . _count || 0 ) + 1 ; } node . addEventListener ( evType , handler ) ; if ( recognizer . touchAction ) { setTouchAction ( node , recognizer . touchAction ) ; } }
automate the event listeners for the native events

@private
@param {!HTMLElement} node Node on which to add the event.
@param {string} evType Event type to add.
@param {function(!Event)} handler Event handler function.
@return {void}
@this {Gestures}
automate the event listeners for the native events