RC RANDOM CHAOS

120 FPS Native-Feeling Web Apps on iOS Safari

· via Hacker News

Original source

Bypassing iOS Safari's 60 FPS Limit to Build Web Applications That Feel Native

Hacker News →

iOS Safari WebKit caps refresh rates at 60 Hz on 120 Hz screens unless a developer flag is enabled, making web apps feel sluggish compared to native applications. Touch and pointer events operate at the same 60 Hz limit, creating a fundamental responsiveness problem for JavaScript-based interactions.

To bypass this, the approach leverages the compositor thread that independently handles scrolling at higher refresh rates. Scrollable areas function as “controllers” that read position data at 120 Hz, allowing developers to apply native-like physics, momentum, and bounce effects without JavaScript overhead. Achieving this requires phase-locking refresh measurements to vsync using MessageChannel and requestAnimationFrame, then running invisible CSS animations to maintain full ProMotion display speeds.

Additional techniques address iOS-specific limitations: scaling scrollable surfaces compensates for rounded scroll values, and scroll-driven animations bypass URL bar throttling. This approach handles dragging and predefined animations directly through the compositor, sidestepping the DOM’s 60 Hz ceiling for interactive components.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.