new PerformanceObserver((list) => {
for (const { sources } of list.getEntries()) {
if (sources && sources.length > 0) {
console.log(sources[0].currentRect);
}
}
}).observe({ type: "layout-shift", buffered: true });LayoutShiftAttribution: currentRect property / notebook
LayoutShiftAttribution: currentRect property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.