Old and odd elements: font, marquee, xmp, blink, a foreign iframe and a footer
Five ideas from the element catalogue about elements at the edges of HTML: the presentational elements of the
1990s, <xmp>, names the parser does not know, a frame from another origin, and a footer used as a floor. Each demo
asks what the element gives a canvas to draw, and what the canvas has to find out some other way.
Old web page in a drawn monitor
A page written with <center>, <font>, <big>, <tt> and <marquee>, drawn on the tube of a monitor: bulged, lined and glowing. The button on the page works. Turn the power off and the picture shrinks to a line.
All five elements still lay out and paint, and the marquee still scrolls by itself. Each of its steps raises a paint event on the canvas, which is the only clock of this demo. The tube is drawn in full 12 times a second, and a copy of the last full frame is put back on the events in between.
Show the code
- The page: one
drawableblock of 1990s markup. - Draw the page once, copy it, and build the tube from the copy.
- Styles.
xmp as a literal code sample
The dark box is an <xmp> element. Its content is markup, and it shows it as text. The box under it is the same text parsed as HTML. Tap the dark box and type: the copy follows, and the canvas colours each tag as it appears.
An <xmp> can't hold a <span>, so the usual way to colour code is closed. The colours here are rectangles the canvas paints under the element's picture, taken from a Range over each tag in its text.
Show the code
- The markup is written once, unescaped, inside the xmp.
- Find the tags, paint their rectangles, draw both elements.
Unknown elements in a design system audit
A paragraph from a page that has collected some odd elements. Press the button: a line passes down the paragraph, and each element it finds that shouldn't be there is outlined and named.
Every one of these elements draws: an unknown name is laid out as an inline element with its text. The outlines are canvas drawing over the picture, placed from each element's client rectangle. Nothing is added to the paragraph.
Show the code
- The paragraph.
- Sort each element into a kind and outline it as the line passes.
Warn about invisible frames
Three frames inside one drawable block, each holding a button. The first is from this origin. The second is a data: URL and the third is sandboxed, so both are other origins: the canvas has no picture of them. Tap all three. Then clear the box and look at what the canvas shows without the warning.
A frame from another origin is an empty box in the picture, and a tap on that empty box still presses the button inside the frame. Without the warning a reader can't see what a tap there will do.
Show the code
- Three frames in one
drawableblock. - Find the frames with no
contentDocumentand hatch them.
Footer that is the floor
A <footer> drawn lying on the ground, with two signs standing on it. Move the slider to tilt the floor. The links in the footer are tapped where they lie.
The picture is drawn in strips because a 2D context has no perspective. The hit region doesn't need strips: updateElementGeometry() takes the perspective matrix itself, and the browser finds the link under a tap on the slanted floor.
Show the code
- A footer and two signs, all
drawable. - One matrix for the strips, the hit region and the places of the signs.
How it works
- What the picture holds. Old elements, unknown elements and
<xmp>are all in the picture of the block around them. A frame from another origin is not. - What the canvas adds. The colours behind the tags, the outlines of the audit and the hatching over a frame are drawn by the canvas from rectangles:
getClientRects()of an element or of aRange, which are reported at the place where the block was last drawn. - Strips. The slant of the floor is many clipped draws of one element, each with its own scale. The bulge of the tube is cut from a
drawImage()copy of one flat draw, which costs one picture of the element for a frame and not eleven. - Frames. A demo asks for frames only while something moves. The monitor is redrawn by the marquee's own paint events.
Show the code
- Each demo starts when its section comes near the screen.
- The paint handler shared by the five canvases.
- Place a block and turn a client rectangle into its pixels.
- After a lost context the elements are shown as plain HTML.
Live checks
The checks wait for a tap. Each builds its own small canvas in a corner of the window, and none of them touches the demos above. One of them reads pixels, from a copy of its fixture made with drawImage().
Findings
Measured in headless Chromium 157 on 2026-11-22. Not yet run on a phone.
- A frame from another origin is a hole in the picture that still takes taps. A pixel inside a
data:frame and inside a sandboxedsrcdocframe had alpha 0 in the canvas. A frame from this origin had its own red there.elementFromPoint()gave the frame in all three, and in the demo one tap on each empty box pressed the button inside. - The canvas can find such a frame without reading pixels.
contentDocumentwas null for the two foreign frames and a document for the third. The warning is drawn from that and from the frame's rectangle. - The elements of the 1990s still draw.
center,big,tt,nobrandacronymare plainHTMLElement,fontisHTMLFontElementandmarqueeisHTMLMarqueeElement. All had boxes and all are in the picture. - A marquee inside a drawable block is a clock for the canvas. It raised 120 paint events in two seconds, and
changedElementsnamed the drawable block in all of them. The first version drew the block ten times on each event, one of them blurred, and the software-rendered test browser spent 10.4 s of a six-second run in long tasks. The page now draws the block once, 12 times a second, copies those pixels withdrawImage()and builds the tube from the copy: 2.8 s in the same run. - Unknown names draw too.
blink,appletandspacerareHTMLUnknownElementand were 36, 47 and 52 px wide with their text. A name with a hyphen that was never defined is anHTMLElement, told apart bycustomElements.get(). - An xmp is text all the way down. Its
textContentwas the markup, it had 0 child elements, and it acceptedcontenteditable="plaintext-only". ARangeover one tag gave a rectangle of 25 by 16 px, which is all the canvas needs to colour it. updateElementGeometry()takes a perspective matrix on a 2D canvas. A button was found at the place the matrix projects it to, and the place where it was drawn flat gave the canvas. The footer's picture needs 3 px strips, and its hit region needs one call.- Not verified: everything on a phone. The cost of redrawing the tube at the marquee's rate, typing into the xmp with an on-screen keyboard, and a frame from a real second site, which may be in another process (the two foreign frames here are a
data:URL and a sandbox).