Course contentsShow
← Web Development
Lesson 2592 of 2,98246. Animation LibrariesFree lesson

The Rendering Pipeline

How browsers process frames through layout, paint, and composite stages.

The Rendering Pipeline

You'll learn how browsers turn your code into visible pixels through three critical stages.

What Is the Rendering Pipeline?

Every time your animation changes a CSS property, the browser must decide how much work to redo. The rendering pipeline is the sequence of steps browsers follow to display each frame:

  1. Layout (also called "reflow") — calculates where every element sits and how big it is
  2. Paint — fills in pixels for text, colors, images, borders, shadows, etc.
  3. Composite — layers painted elements together and sends them to the screen

How It Works

Think of building a stage play: Layout is positioning actors and props, Paint is applying makeup and costumes, and Composite is adjusting the lighting and curtains before the audience sees it.

Different CSS properties trigger different stages:

  • Changing width, height, margin, or padding triggers Layout → Paint → Composite (most expensive)
  • Changing color, background, or box-shadow skips Layout but requires Paint → Composite (moderate cost)
  • Changing transform or opacity only needs Composite (cheapest, GPU-accelerated)

Why This Matters for Animations

At 60fps, you have just 16.67ms per frame. If your animation forces Layout every frame, the browser may miss the deadline, causing jank. This is why animation libraries like GSAP and Framer Motion prefer animating transform and opacity—they skip the expensive stages.

When you animate position with left/top, you're triggering Layout. When you animate with translateX/translateY, you only trigger Composite—same visual result, 10x faster.

Key Takeaway: Understanding which CSS properties trigger which pipeline stages lets you build smooth 60fps animations by avoiding Layout and Paint whenever possible.