<aside> 💡

A browser runs two separate clocks: the display refresh, and the page's rendering update (rAF, style, layout, paint). On a 120Hz screen, iOS Safari still throttles the second one to about 60Hz by default, and the HTML spec allows it to. Scrolling (momentum, bounce, snapping) and some CSS animations run on the compositor side and are not capped. A post that circulated in late November got 120Hz input and 120Hz rendering out of iOS Safari with two tricks: (1) treating a scroll area as an input device, and (2) using the fact that an OffscreenCanvas placeholder reaches the screen without waiting for the rendering update. This piece uses that work to sort out where a page's frame rate actually gets decided.

</aside>

Why this, why now

The useful lesson for implementers isn't the specific trick. It's being able to tell which work runs on which clock, and this case shows that very clearly.

The problem

1. The user agent decides what a "rendering opportunity" is

The HTML event loop defines a rendering opportunity as a moment when the user agent can currently present the navigable's contents to the user, "accounting for hardware refresh rate constraints and user agent throttling for performance reasons." The spec says explicitly that it doesn't mandate any particular model. As examples, it describes aiming for 60Hz (about every 16.7ms), dropping to 30 per second if that can't be sustained, and going down to 4 per second or less for a page that isn't visible.

So capping rendering updates at 60Hz on a 120Hz display doesn't violate the spec. rAF callbacks, style recalculation, layout, and paint all run together inside "update the rendering." If rAF fires 60 times a second, the DOM's appearance changes only 60 times a second.

2. WebKit rounds to the divisor closest to 60

WebKit's UnifiedWebPreferences.yaml contains PreferPageRenderingUpdatesNear60FPSEnabled, with the display name "Prefer Page Rendering Updates near 60fps." It has status: stable and defaults to true on every platform except visionOS.

The math is in framesPerSecondNearestFullSpeed() in AnimationFrameRate.cpp. If the nominal refresh rate is above 60, the function divides it by an integer to land near 60, so 120 becomes 60. On top of that, four conditions halve the rate again (halfSpeedThrottlingReasons): Low Power Mode, a cross-origin iframe the user hasn't interacted with, a visually idle page, and aggressive thermal mitigation. That is why rAF drops to 30Hz in Low Power Mode.

// WebKit: Source/WebCore/platform/graphics/AnimationFrameRate.cpp (excerpt)
FramesPerSecond framesPerSecondNearestFullSpeed(FramesPerSecond nominalFramesPerSecond)
{
    if (nominalFramesPerSecond <= FullSpeedFramesPerSecond)
        return nominalFramesPerSecond;
    float fullSpeedRatio = nominalFramesPerSecond / FullSpeedFramesPerSecond;
    FramesPerSecond floorSpeed = nominalFramesPerSecond / std::floor(fullSpeedRatio);
    FramesPerSecond ceilSpeed = nominalFramesPerSecond / std::ceil(fullSpeedRatio);
    return fullSpeedRatio - std::floor(fullSpeedRatio) <= 0.5 ? floorSpeed : ceilSpeed;
}

In WebKit Bugzilla 290671, Antoine Quint of WebKit put it this way: "Scroll-driven Animations will update at the same cadence as all other page rendering updates, which is 60Hz by default on ProMotion displays. This is true not just for non-accelerated animations, but all page rendering, including requestAnimationFrame callbacks." The same bug explains that Safari has no acceleration support for scroll-driven animations yet; threaded animation resolution is tracked in bug 250970. So, unlike in Chrome, CSS scroll-driven animations in Safari currently run on the 60Hz side too.

3. What runs outside the cap

The things that escape the cap are the ones that never go through the page's rendering update: