# Browser Rendering Pipeline (Critical Rendering Path) vs content-visibility & Skipping Offscreen Work

- **Canonical URL:** https://frontend.rocks/vs/browser-rendering-pipeline-vs-content-visibility/
- **Relation:** Contrasts With
- **Last Verified:** 2026-11-15
- **Verdict:** content-visibility: auto skips Layout and Paint for offscreen subtrees instead of running the full pipeline.

## Comparison Matrix

| Dimension | Browser Rendering Pipeline (Critical Rendering Path) | content-visibility & Skipping Offscreen Work |
| :--- | :--- | :--- |
| **Maturity** | Baseline · Widely | Baseline · Newly |
| **Domain** | Rendering Pipeline | Rendering Pipeline |
| **Mental Model** | Avoid 60fps-killing main-thread reflows by targeting compositor-only properties—every geometric DOM write forces Style, Layout, Paint, and Composite to re-run. | content-visibility: auto skips layout and paint for off-screen subtrees while keeping them searchable in the DOM. |
| **Prerequisites** | DOM & CSSOM Construction (Style calculation requires parsed DOM and CSSOM trees before constructing the render tree.) | CSS Containment (content-visibility: auto internally activates layout, style, and paint containment.) |
| **When Not to Use** | When not to use manual promotion: Do not force translateZ(0) on static elements; let the engine promote layers only during active animations. | When not to use content-visibility: auto: Do not apply it to small above-the-fold elements or containers with overflowing popovers (it implies contain: paint). |

## Browser Rendering Pipeline (Critical Rendering Path) — Under the Hood
Blink executes frame rendering as a strict unidirectional pipeline from Style through Layout, Paint, Layerize, and Composite. Modifying geometry at Layout invalidates every downstream stage, whereas mutating `transform` or `opacity` updates a GPU compositor matrix directly without re-running Style, Layout, or Paint.

1. **Style (Recalc Style)**: Blink matches every node from [DOM & CSSOM Construction](/concepts/dom-cssom-construction) against CSSOM rules (governed by [CSS Cascade Layers](/concepts/css-cascade-layers)) and computes resolved `ComputedStyle` values (unless skipped offscreen via [content-visibility](/concepts/content-visibility)).
2. **Layout (Reflow)**: The engine computes exact geometry (boxes, `x/y` coordinates, widths, heights) in the `LayoutTree`.
3. **Paint**: Emits a list of draw instructions (`DisplayItems`: backgrounds, borders, glyphs) sorted by [CSS Stacking Context](/concepts/css-stacking-context), without rasterizing yet.
4. **Composite**: The `Compositor Thread` splits [GPU Compositor Layers](/concepts/gpu-compositor-layers) into tiles, rasterizes them on GPU, and applies `transform` / `opacity` without blocking the main thread.

```css
/* Triggers Layout -> Paint -> Composite (expensive on main thread) */
.drawer.open {
  left: 0;
  width: 320px;
}

/* Skips Layout and Paint; runs on Compositor Thread */
.drawer-fast.open {
  transform: translate3d(0, 0, 0);
}
```

| Mutated Property | Triggered Phases | Main Thread Cost |
| :--- | :--- | :--- |
| `width` / `top` / `margin` | Style -> Layout -> Paint -> Composite | High |
| `background-color` / `box-shadow` | Style -> Paint -> Composite | Medium |
| `transform` / `opacity` | Composite only (if promoted layer) | Near zero |

## content-visibility & Skipping Offscreen Work — Under the Hood
Like a stage crew only lighting sets as actors walk toward them, `content-visibility: auto` keeps DOM nodes intact while deferring pixel work.

1. **Relevance Check**: The engine checks whether the element is near the viewport, focused, or selected.
2. **Work Suppression**: When irrelevant, it enforces [CSS Containment](/concepts/css-containment) (`layout`, `style`, `paint`, `size`) and skips [Render Tree & Layout](/concepts/render-tree-layout) for descendants.
3. **Placeholder Sizing**: `contain-intrinsic-size: auto 400px` supplies a fallback height until the element renders once, after which `auto` remembers its real measured height.

```css
.long-list-chunk {
  content-visibility: auto;
  /* Remembers real height after first render; 360px before */
  contain-intrinsic-size: auto 360px;
}
```

## Interactive Labs & Dissections
- [Browser Rendering Pipeline (Critical Rendering Path) Lab](https://frontend.rocks/concepts/browser-rendering-pipeline/#lab) ([Markdown](https://frontend.rocks/concepts/browser-rendering-pipeline.md))
- [content-visibility & Skipping Offscreen Work Lab](https://frontend.rocks/concepts/content-visibility/#lab) ([Markdown](https://frontend.rocks/concepts/content-visibility.md))

## Related Architecture Autopsies
- [Autopsy #09: 60 FPS on MacBook Pro, 11 FPS on Mid-Range Android](https://frontend.rocks/autopsies/mobile-scroll-jank-vram-explosion/) ([Markdown](https://frontend.rocks/autopsies/mobile-scroll-jank-vram-explosion.md)): A card grid scrolls at 60 FPS on MacBook Pro but stutters at 11 FPS and OOM-kills the browser tab on mid-range Android.

## Primary Sources
- https://developer.mozilla.org/en-US/docs/Web/Performance/Critical_rendering_path
- https://web.dev/articles/renderingng-architecture
- https://drafts.csswg.org/css-contain-2/#content-visibility
- https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility
