Skip to content

HadRecentInput and Animation Frames: shifts painted together, should be ignored together. #123

@mmocny

Description

@mmocny

TL;DR: Consider changing to ignoring the "whole animation frame" worth of shifts as a unit, since animation frame visually appear as a single paint for the user.


After an Interaction with the page, the next 500ms is given an exclusion window, such that any reported shifts are marked as has_recent_input: true and will not be added to the CLS score for the page.

However, Layout Instability is a user experience diagnostic as much as it is a performance diagnostic. And Layout isn't actually visually affecting the user until after the next paint (i.e update-the-rendering steps are complete).

The net effect is that, 500ms after an interaction with the page is processed, we switch from treating layout as has_recent_input in the middle of a random animation frame, and, any layout that is forced to compute eagerly within that frame might get ignored, yet any layout that is lazily computed at the end of that frame might get counted towards CLS. This feels inconsistent and not meeting UX expectations (and in a tiny way, potentially even promoting bad practices).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions