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

@best

Bypassing iOS Safari's 60 FPS Limit to Build Web Applications That Feel Native rida.dev · 42 points · 12 comments · HN thread

TL;DR The author reports a technique for reading touch and scroll input on iOS Safari at 120 Hz without the 'Prefer Page Rendering Updates near 60fps' flag: an invisible scroll container is read through a MessageChannel phase-locked to vsync, and canvas content is rendered via OffscreenCanvas, which WebKit presents without waiting for the main-thread rendering pass. The result is a demo tab bar with a Liquid Glass effect running at 120 FPS on an iPhone 18 Pro, and a claim that the 60 FPS cap is avoidable on iOS Safari.

  • WebKit limits requestAnimationFrame and pointer/touch events to 60 Hz on 120 Hz iPhones unless a Safari developer flag is enabled.
  • Reading scrollTop/scrollLeft synchronously via MessageChannel throttled to the device refresh rate yields about 80 to 90 unique position reads per second, later raised to near 120 with a tiny smooth-scrolling background scroller.
  • Scroll positions are rounded to integers, fixed by scaling the scroll surface by the device pixel ratio and its container back down.
  • Calling transferControlToOffscreen on a canvas gives an OffscreenCanvas that WebKit presents without waiting for the next rendering pass, enabling 120 FPS canvas rendering.
  • In a benchmark on an iPhone 18 Pro, a controller-based drag averaged 118 FPS versus a steady 60 for pointer events, and about 60 FPS even in Low Power Mode.
  • The author notes Apple could remove this behaviour at any time, and says he would not rebuild a whole application around it.

Discussion The thread is short and mostly skeptical or amused. Several commenters tried the demo on iOS Safari and could not see any difference between the two grids, which undercuts the article's central claim in their experience. Others focused on the Liquid Glass widget, with one joking that it induces ocular-migraine-like effects and two saying it did make them feel unwell. The tone is light, with a small technical disagreement about whether 60 FPS is acceptable at all.

  • Visual difference between 60 and 120 FPS not perceptible in the demo (some): Several iOS Safari users said they could not tell which grid was the controller version and which used pointer events, and one said they tried several motions without success. This directly challenges the article's premise that the difference is immediately obvious.
  • A 60 FPS cap is still acceptable for web apps (a few): One commenter argued that 60 FPS is serviceable and that the article's first example updates at most 60 times a second with frame drops, calling the piece disingenuous. Another replied that capping an app at half the display's refresh rate is hard to justify, given how noticeable the difference is.
  • The Liquid Glass widget is visually distracting (some): Commenters said the animated glass element caused ocular-migraine-like effects and nausea, with at least one saying it triggered a migraine aura. This is a reaction to the demo, not to the technique.
  • The glass effect resembles Apple's Liquid Glass (a few): One commenter found the demo's glass more convincing than Apple's version, praising the chromatic aberration. Another replied that Liquid Glass does have chromatic aberration and the demo closely matches certain configurations.

#iOS #Safari #WebKit #OffscreenCanvas #HighRefreshRate #WebPerformance