Layout debugger overlay

The canvas draws an article, and over it the boxes that layout gave each element: margin in orange, padding in green, the baseline of each line of text in pink. Tap a part of the article to see that element alone, with its size. Drag "Width" to make the article lay out again. "Turn the picture" draws the article at an angle, and the overlay turns with it.

Harbour times

The gate opens at 6 and the ferry leaves on the hour.

DayHighLow
Mon05:4011:52
Tue06:3112:44
2 days
  • Margins of the list items collapse.
  • The row above is a flex box with a gap.

Type here. The boxes are measured again after each change.

Show the code measure at 0, 0 with no ink, then draw the element and its boxes
  1. The markup. One drawable child. Nothing is added to it for the overlay.
  2. A measuring draw. The element is drawn at 0, 0 with globalAlpha = 0 so that client rectangles are layout positions.
  3. The boxes and the baselines.
  4. One frame. Measure, draw the article with its transform, draw the overlay with the same transform.
  5. Drawing the boxes.
  6. Picking an element. A tap reaches the element itself, because hit testing follows the draw.

How it works

Live checks

Each check builds a small canvas of its own in a corner of the window. The picture above isn't touched.

ResultExperimentDetail

Findings

From Chromium 157, headless, on 2026-11-21. The rows above say what your browser does.