See which CSS properties trigger Layout, Paint, or Composite-only changes
Every frame the browser displays goes through up to 5 stages:
transform and opacity for animations — they skip Layout and Paint entirelywidth, height, top, left — they trigger Layout on every framewill-change to promote elements to their own compositor layer (use sparingly)contain: layout paint limits the scope of Layout and Paint to the element's subtreeoffsetWidth, getBoundingClientRect()) after writing forces synchronous layoutThe browser batches style/layout changes. But if you read a layout property after writing, the browser must calculate layout immediately:
elem.style.width = '100px'; const w = elem.offsetWidth; — forces layout between these two lines