LayoutShiftAttribution Class

A node that shifted in a LayoutShift (https://wicg.github.io/layout-instability/#sec-layout-shift-attribution).

public sealed class LayoutShiftAttribution

Properties

NameDescription
CurrentRectGets the smallest rectangle that contains the visible part of the node in the current frame, in the coordinates of the viewport (CSS pixels).
NodeGets the node that shifted, or null when it is not connected, when it is in a shadow tree ("get an element") or for a pseudo-element (which is not a node).
PreviousRectGets the smallest rectangle that contains the visible part of the node in the previous frame, in the coordinates of the viewport (CSS pixels).

CurrentRect

LayoutShift.cs

Gets the smallest rectangle that contains the visible part of the node in the current frame, in the coordinates of the viewport (CSS pixels).

public DomRectReadOnly CurrentRect { get; }

Gets the node that shifted, or null when it is not connected, when it is in a shadow tree ("get an element") or for a pseudo-element (which is not a node).

public Node? Node { get; }

PreviousRect

LayoutShift.cs

Gets the smallest rectangle that contains the visible part of the node in the previous frame, in the coordinates of the viewport (CSS pixels).

public DomRectReadOnly PreviousRect { get; }