Every HTML element inside a drawable canvas

What does each HTML element do as a child of <canvas content="drawable">: is it drawn, can it be hit, does it take input? Each row below is one element that was put in a canvas and measured, with one thing that could be built with it. The measurements also decide which of the ideas further down are possible.

Runs the draw, ink, hit-test and repaint measurements for every row on small canvases in the corner of the window. It takes about 20 seconds and doesn't click or type.

Show the code how one element is measured
  1. Build the test markup. Each entry in data.js is a tag name and a string of HTML. The element under test sits in a wrapper div.
  2. Draw it and measure. The node goes into a new drawable canvas and is drawn at (6, 6). Ink is the share of the element's box with a drawn pixel. The hit test asks elementsFromPoint() at the centre of the drawn box. Paint events counted while nothing touches the element show whether it repaints on its own.
  3. Measure both ways. Once inside a drawable wrapper, once as the drawable child itself, and once more with display: block forced when the element has no box.
  4. Turn the numbers into the label on each row.
  5. "Draw it here": a canvas you can use. The same markup, drawn with a small rotation so native popups and hit regions can be compared with the picture.
  6. Check each idea against the measurements. ideas.js lists what each idea needs; evaluate() looks those entries up.
  7. The list of elements and their test markup.

The recorded results also include checks made with real mouse and keyboard input. Those are driven by tools/elements/record.mjs (run npm run record:elements), because a page can't send itself trusted clicks.

Findings

Ideas

All elements

How to read a row