← Chrome 148 reference

v148 · performance · origin trial

Long Animation Frames style duration

Two new timing fields — styleDuration and forcedStyleDuration — added to the Long Animation Frames (LoAF) API, letting developers distinguish time spent in style and layout from other work inside a slow frame.

Origin trial These new fields are in origin trial in Chrome 148. The final property names may differ. Track the spec PR linked below before relying on these in production.

at a glance

Status in Chrome 148Origin trial
FlagNone when OT token is present
Spec PRw3c/long-animation-frames PR #30
Standards position (Firefox)No signal
Standards position (Safari)No signal
ChromeStatus5171478175809536 — Long Animation Frames style duration
Source: chromestatus.com/feature/5171478175809536

why it exists

The Long Animation Frames API (LoAF) reports every frame that takes more than 50 ms to render. Before this addition, the PerformanceLongAnimationFrameTiming entry exposed total frame duration (duration) and script execution time (blockingDuration), but lumped style recalculation and layout into the general duration bucket. In pages that trigger forced layouts (style reads after DOM writes), style and layout often dominate the slow frame — but developers had no way to confirm this from the LoAF entry alone.

Adding styleDuration (total time for style + layout) and forcedStyleDuration (time for forced style + layout triggered mid-frame) makes it possible to diagnose layout-thrashing patterns directly from the performance timeline.

Source: chromestatus feature summary; spec PR #30

shape of the API

Two new properties on PerformanceLongAnimationFrameTiming:

PropertyTypeDescription
styleDurationDOMHighResTimeStampTotal time (ms) spent in style recalculation and layout during the frame
forcedStyleDurationDOMHighResTimeStampSubset of styleDuration that was forced (layout triggered mid-frame by a script)

All other existing LoAF properties (duration, blockingDuration, renderStart, scripts, etc.) remain unchanged.

Source: w3c/long-animation-frames PR #30

example

const observer = new PerformanceObserver((list) => {
  for (const entry of list.getEntries()) {
    if (entry.entryType !== 'long-animation-frame') continue;

    console.log(`LoAF: ${entry.duration.toFixed(1)} ms total`);
    console.log(`  style+layout:        ${entry.styleDuration.toFixed(1)} ms`);
    console.log(`  forced style+layout: ${entry.forcedStyleDuration.toFixed(1)} ms`);

    // Threshold: warn if >50% of the frame is forced layout
    const forcedRatio = entry.forcedStyleDuration / entry.duration;
    if (forcedRatio > 0.5) {
      console.warn('Layout thrashing detected in this frame');
    }
  }
});

observer.observe({ type: 'long-animation-frame', buffered: true });
Pattern from developer.chrome.com — Long Animation Frames

browser support

BrowserSupportNotes
Chrome 148Origin trialstyleDuration and forcedStyleDuration
FirefoxNo signal
SafariNo signal
Source: chromestatus.com/feature/5171478175809536

see also