Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScriptrequestAnimationFrame timingSingle-choice MCQ

Inside a single requestAnimationFrame callback you both write to and read from layout-affecting DOM properties. What does the browser's rendering pipeline do, and why does this pattern hurt frame timing?

function frame() { el.style.width = box.offsetWidth + 1 + 'px'; other.style.width = other.offsetWidth + 1 + 'px'; requestAnimationFrame(frame); }