Mechanical ComparisonPassive Event Listeners and Compositor Scrolling: Baseline · WidelyPointer Events, touch-action, and Pointer Capture: Baseline · Widely

Passive Event Listeners and Compositor Scrolling vs Pointer Events, touch-action, and Pointer Capture

Mechanical Verdict

Passive listeners promise no preventDefault() in JS, whereas CSS touch-action declares scroll constraints to the compositor.

Try Passive Event Listeners and Compositor Scrolling LabTry Pointer Events, touch-action, and Pointer Capture LabRead Passive Event Listeners and Compositor Scrolling DissectionRead Pointer Events, touch-action, and Pointer Capture Dissection

Structured Comparison Matrix

DimensionPassive Event Listeners and Compositor ScrollingPointer Events, touch-action, and Pointer Capture
Mental ModelEliminate 100ms+ mobile scroll-start jank—{ passive: true } promises the GPU compositor thread that wheel/touch listeners will never call preventDefault().Stop mobile browser scroll from hijacking custom drags and sliders—CSS touch-action negotiates gesture ownership on the compositor while setPointerCapture() locks fast pointer streams.
Maturity & DomainBaseline · Widely · DOM & Events
Chrome 51+ · Firefox 49+ · Safari 10+
Baseline · Widely · DOM & Events
Chrome 55+ · Firefox 59+ · Safari 13+
Prerequisites
When Not to UseWhen not to use { passive: false }: Avoid { passive: false } on general page wrappers just to suppress scroll conditionally; use CSS touch-action via Pointer Events & touch-action instead.When not to use touch-action: none: Never apply touch-action: none to large scrollable sections, it traps mobile users who try to scroll past the widget.

Engine Mechanics & Trade-Offs

Passive Event Listeners and Compositor ScrollingBaseline · Widely

Non-passive wheel/touch listeners force the compositor thread to wait for main-thread JS to check preventDefault(); { passive: true } unlocks immediate compositor scrolling.

Key Pitfalls: Ignored preventDefault() on document: Calling e.preventDefault() inside a document-level wheel listener logs a warning and fails to stop scrolling unless { passive: false } is set. Third-Party Tracking Scripts: Non-passive touchstart listeners attached to inner containers silently re-introduce scroll jank.

Pointer Events, touch-action, and Pointer CaptureBaseline · Widely

CSS touch-action instructs the compositor up front which gestures belong to the browser vs JS, preventing pointercancel during custom drags.

Key Pitfalls: Missing touch-action on Sliders: Forgetting touch-action: pan-y on a horizontal carousel causes mobile browsers to abort drags with pointercancel. Orphaned Drag State: Relying on pointerup on the knob without setPointerCapture() drops the release event when the cursor leaves the element.

Seen in Architecture Autopsies