Iframes as tiles: sizing, focus, prerender and limits

An <iframe> can be a child of a drawable canvas, and the canvas draws the whole embedded document. I had four questions about that: can a tile take its height from the document inside it, can the embedder stop a tile from taking focus, is a cross-origin tile loaded while the page is prerendered, and what does the canvas get from a cross-origin tile.

Tiles A and B come from this origin. Tile C comes from another origin. Each tile's height is the height of its document: press Add a line, here or inside a tile, and the board moves the others. Tile C is drawn as an outline with a note, because a canvas receives no pixels from a cross-origin iframe. It still takes clicks and typing where it is drawn.

Show the code tiles that size themselves
  1. The tiles are iframes inside the canvas.
  2. CSS asks for content sizing. Chromium 157 parses this and does nothing with it, so step 4 does the same job by message.
  3. The embedded document opts in.
  4. Fallback: the tile reports its height and the board applies it.
  5. Lay the tiles out and draw them.
  6. What a tile does to take focus, and the attribute that is meant to stop it.
  7. The prerendered page.

Measurements

These run on separate fixtures in a corner of the window, not on the board. One of them moves keyboard focus into a fixture and back, so they wait for this button.

ResultExperimentDetail

Prerender

When a page is prerendered, its same-origin iframes load with it and its cross-origin iframes wait until the page is shown. From Chrome 159 a page sent with Supports-Loading-Mode: prerender-cross-origin-frames has its cross-origin iframes loaded during prerender too. Two copies of a small board are compared, one sent with the header and one without. Press the button, wait a few seconds, then open each link. Each page reports what had already happened when it was shown.

Findings