New researchTechnical SEO & AI Search · 2027Explore the framework

Long Animation Frames and INP: find the work behind slow clicks

Use Long Animation Frames data to connect slow interactions with script, rendering and layout work, then verify INP improvements in the field.

Part of the Core Web Vitals series. For the full picture, start with Core Web Vitals: what they are, how they affect SEO and how to improve them.

An INP warning says a page felt slow after someone clicked, tapped or typed. It does not identify the handler, layout pass or paint that caused the delay. Long Animation Frames data adds a useful view of the work surrounding that interaction.

What are Long Animation Frames for INP?

The Chrome documentation defines a long animation frame as a rendering update delayed beyond 50 ms. The LoAF API reports frame duration, render timing, blocking duration and, when available, script attribution. It can reveal several small tasks that collectively delay a paint, which a list of individual long tasks may miss.

LoAF is a diagnostic, not a replacement for the INP metric. INP measures the latency of a user’s interaction through the next paint; a long frame only matters to that metric when it overlaps the relevant interaction.

Which LoAF fields explain a slow interaction?

Field Question it helps answer Caveat
duration How long did the frame take? Includes frames unrelated to input
blockingDuration How much work would block higher-priority input? Not the same as INP duration
renderStart When did rendering begin? A missing value means no render in that frame
styleAndLayoutStart Did style and layout consume the tail? Follow up with a trace
scripts Which script entry points contributed? Attribution can be unavailable or incomplete

Chrome notes that script attribution covers main-thread code, including same-origin iframes, but not all cross-origin or worker activity. A reported event handler is an entry point, not necessarily the deep function consuming the time.

How do you collect useful LoAF evidence?

First, find the affected page template and interaction from field data. Then reproduce that action with a browser performance trace. If you collect LoAF in real users’ sessions, check API support before observing long-animation-frame entries. Attach the interaction target, URL template and timestamp to your own telemetry so the frame can be matched with a slow action. Avoid collecting unnecessary user data.

if (PerformanceObserver.supportedEntryTypes.includes('long-animation-frame')) {
  new PerformanceObserver((list) => {
    for (const frame of list.getEntries()) {
      if (frame.blockingDuration > 0) console.log(frame.duration, frame.scripts)
    }
  }).observe({ type: 'long-animation-frame', buffered: true })
}

This example is for diagnosis, not production logging as written. Sampling, retention and privacy controls matter before shipping telemetry.

What fixes follow from the trace?

Reduce the specific expensive work: split a heavy event handler, avoid repeated synchronous layout reads and writes, defer nonessential startup code, or simplify rendering on the affected component. The first-party JavaScript guide covers app-code causes; the third-party script audit covers vendor code.

After deployment, compare the same interaction in the lab and wait for field INP data to reflect real visits. A smaller LoAF count alone is not proof that the page’s INP improved.

LoAF investigation checklist

  • Identify the slow page template and user action
  • Check browser support before collecting LoAF entries
  • Match frames to interactions, not just page loads
  • Inspect script attribution and render/layout timing
  • Reproduce with a performance trace before editing code
  • Verify the fix against interaction latency and field INP

The goal is to remove the work that holds up the next paint, not to chase every long frame on the page.

Frequently asked questions

Is a long animation frame the same as a long task?

No. A long task measures one task occupying the main thread for at least 50 ms. A long animation frame can combine several tasks and rendering work before the browser paints.

Does every LoAF hurt INP?

No. A long frame may occur without a user interaction, and a frame with little blocking duration may still be responsive to input. Correlate it with the slow interaction before prioritizing a fix.

Can LoAF tell me the exact slow function?

It can report script source and entry-point attribution when available, but not always the precise downstream function doing the expensive work. Use a browser performance trace to follow the call stack.

Can I rely on LoAF in every browser?

No. Check support with PerformanceObserver.supportedEntryTypes before collecting it. Keep ordinary interaction timing and lab traces as fallbacks.

· Founder, Crawlens

Dien builds Crawlens, a desktop crawler for technical SEO audits, and writes about the checks it runs: crawling, indexing, rendering and Search Console data.

Audit your own site with Crawlens

Crawl, run 70 checks, and see them next to Search Console and Core Web Vitals data.

Download free for Windows