How we built it

Intervention: Passive Touch Event Listeners During Fling

Passive Event Listeners is a way to improve the scroll performance by unblocking scrolling on touch and wheel event listeners, so that scrolling happens immediately while the events are processed by javascript. alexclarke@ proposed that we should treat all the touchstart and first touchmove event listeners as passive while there’s an active fling animation.

Comments

Safari sets events’ cancelable to be false while the fling animation is active, and calling ‘preventDefault’ does not have any effect on them. Our intervention has the same behaviors, but we see non-cancelable events more often, maybe because our configured fling speed is lower or fling interval is longer. Firefox and IE/Edge do not handle the event listeners at all during fling.

Demo

Documentation

Status in Chromium

Behind a flag (launch bug) in:

  • Chrome for desktop release 54
  • Chrome for Android release 54
  • Android WebView release 54
  • Opera release 41
  • Opera for Android release 41

Consensus & Standardization

  • Shipped
  • Shipped
  • Shipped
  • Positive

Owners

Last updated on 2016-11-30