lib/third_party/tracing/extras/rail/rail_ir_finder.js
function(sortedInputEvents) {
      var protoIRs = [];
      var currentPIR = undefined;
      var sawFirstUpdate = false;
      forEventTypesIn(sortedInputEvents, SCROLL_TYPE_NAMES, function(event) {
        switch (event.typeName) {
          case INPUT_TYPE.SCROLL_BEGIN:
            // Always begin a new PIR even if there already is one, unlike
            // PinchBegin.
            currentPIR = new ProtoIR(ProtoIR.RESPONSE_TYPE, SCROLL_IR_NAME);
            currentPIR.pushEvent(event);
            protoIRs.push(currentPIR);
            sawFirstUpdate = false;
            break;

          case INPUT_TYPE.SCROLL_UPDATE:
            if (currentPIR) {
              if (currentPIR.isNear(event, INPUT_MERGE_THRESHOLD_MS) &&
                  ((currentPIR.irType === ProtoIR.ANIMATION_TYPE) ||
                  !sawFirstUpdate)) {
                currentPIR.pushEvent(event);
                sawFirstUpdate = true;
              } else {
                currentPIR = new ProtoIR(ProtoIR.ANIMATION_TYPE,
                    SCROLL_IR_NAME);
                currentPIR.pushEvent(event);
                protoIRs.push(currentPIR);
              }
            } else {
              // ScrollUpdate without ScrollBegin.
              currentPIR = new ProtoIR(ProtoIR.ANIMATION_TYPE, SCROLL_IR_NAME);
              currentPIR.pushEvent(event);
              protoIRs.push(currentPIR);
            }
            break;

          case INPUT_TYPE.SCROLL_END:
            if (!currentPIR) {
              console.error('ScrollEnd without ScrollUpdate? ' +
                            'File a bug with this trace!');
              var pir = new ProtoIR(ProtoIR.IGNORED_TYPE);
              pir.pushEvent(event);
              protoIRs.push(pir);
              break;
            }
            currentPIR.pushEvent(event);
            break;
        }
      });
      return protoIRs;
    }
function(sortedInputEvents) {
      var protoIRs = [];
      var currentPIR = undefined;
      var sawFirstUpdate = false;
      forEventTypesIn(sortedInputEvents, SCROLL_TYPE_NAMES, function(event) {
        switch (event.typeName) {
          case INPUT_TYPE.SCROLL_BEGIN:
            // Always begin a new PIR even if there already is one, unlike
            // PinchBegin.
            currentPIR = new ProtoIR(ProtoIR.RESPONSE_TYPE, SCROLL_IR_NAME);
            currentPIR.pushEvent(event);
            protoIRs.push(currentPIR);
            sawFirstUpdate = false;
            break;

          case INPUT_TYPE.SCROLL_UPDATE:
            if (currentPIR) {
              if (currentPIR.isNear(event, INPUT_MERGE_THRESHOLD_MS) &&
                  ((currentPIR.irType === ProtoIR.ANIMATION_TYPE) ||
                  !sawFirstUpdate)) {
                currentPIR.pushEvent(event);
                sawFirstUpdate = true;
              } else {
                currentPIR = new ProtoIR(ProtoIR.ANIMATION_TYPE,
                    SCROLL_IR_NAME);
                currentPIR.pushEvent(event);
                protoIRs.push(currentPIR);
              }
            } else {
              // ScrollUpdate without ScrollBegin.
              currentPIR = new ProtoIR(ProtoIR.ANIMATION_TYPE, SCROLL_IR_NAME);
              currentPIR.pushEvent(event);
              protoIRs.push(currentPIR);
            }
            break;

          case INPUT_TYPE.SCROLL_END:
            if (!currentPIR) {
              console.error('ScrollEnd without ScrollUpdate? ' +
                            'File a bug with this trace!');
              var pir = new ProtoIR(ProtoIR.IGNORED_TYPE);
              pir.pushEvent(event);
              protoIRs.push(pir);
              break;
            }
            currentPIR.pushEvent(event);
            break;
        }
      });
      return protoIRs;
    }
function ( sortedInputEvents ) { var protoIRs = [ ] ; var currentPIR = undefined ; var sawFirstUpdate = false ; forEventTypesIn ( sortedInputEvents , SCROLL_TYPE_NAMES , function ( event ) { switch ( event . typeName ) { case INPUT_TYPE . SCROLL_BEGIN : // Always begin a new PIR even if there already is one, unlike // PinchBegin. currentPIR = new ProtoIR ( ProtoIR . RESPONSE_TYPE , SCROLL_IR_NAME ) ; currentPIR . pushEvent ( event ) ; protoIRs . push ( currentPIR ) ; sawFirstUpdate = false ; break ; case INPUT_TYPE . SCROLL_UPDATE : if ( currentPIR ) { if ( currentPIR . isNear ( event , INPUT_MERGE_THRESHOLD_MS ) && ( ( currentPIR . irType === ProtoIR . ANIMATION_TYPE ) || ! sawFirstUpdate ) ) { currentPIR . pushEvent ( event ) ; sawFirstUpdate = true ; } else { currentPIR = new ProtoIR ( ProtoIR . ANIMATION_TYPE , SCROLL_IR_NAME ) ; currentPIR . pushEvent ( event ) ; protoIRs . push ( currentPIR ) ; } } else { // ScrollUpdate without ScrollBegin. currentPIR = new ProtoIR ( ProtoIR . ANIMATION_TYPE , SCROLL_IR_NAME ) ; currentPIR . pushEvent ( event ) ; protoIRs . push ( currentPIR ) ; } break ; case INPUT_TYPE . SCROLL_END : if ( ! currentPIR ) { console . error ( 'ScrollEnd without ScrollUpdate? ' + 'File a bug with this trace!' ) ; var pir = new ProtoIR ( ProtoIR . IGNORED_TYPE ) ; pir . pushEvent ( event ) ; protoIRs . push ( pir ) ; break ; } currentPIR . pushEvent ( event ) ; break ; } } ) ; return protoIRs ; }
The first ScrollBegin and the first ScrollUpdate comprise a Response, then the rest comprise an Animation.  RRRRRRRAAAAAAAAAAAAAAAAAAAA BBB UUU UUU UUU UUU UUU EEE
The first ScrollBegin and the first ScrollUpdate comprise a Response then the rest comprise an Animation . RRRRRRRAAAAAAAAAAAAAAAAAAAA BBB UUU UUU UUU UUU UUU EEE