View source

Peel this page back to read the HTML the server sent

A canvas draws this whole page. Drag the turned corner at the top right towards the bottom left, or press the first button. Under the page is its HTML as the server sent it, and nothing else. A second page has the DOM as it is now under it.

The page is flat. Its top right corner is turned over.

HTML as senttext in a shadow root
This pagea child of the canvas
Canvasdraws the page through a shader
Handle
The four layers of this page, from the bottom.

What the server sent

Measured from a second request for this address, made when the page loaded. The text of that response is what is under the page.

Response body
…
Lines
…
First byte after
…
Content type
…
Same length as the response this page was parsed from
…

Chunks of the response, by size …

Nodes added while the document was loading, by batch …

Change the page

Each block changes the DOM in one way. The text under this page doesn't change when you use them: it's what the server sent. On the second page the same blocks change the text.

A clock

Every second: one text node and the datetime attribute.

A counter

0

Each press: the data-count attribute and the text of an <output>.

A list

  1. Row 1, sent by the server
  2. Row 2, sent by the server

Elements are added, moved and removed.

A colour

One custom property in the style attribute of #sheet. The canvas draws the whole page again.

A <details> element

Open this

The browser adds the open attribute when the element opens and removes it when it closes.

One attribute, written by the browser.

A text field and a checkbox

Typing and ticking change properties. The attributes, and so the live DOM text, keep what the server sent until the button copies them.

Editable text

Change this sentence.

Each key press changes a text node.

A canvas inside the page

Drawn twice

A second drawable canvas, drawn into the picture of the first. Its button changes its own text.

Show the code the layers, the shader, the drag, and reading the response as a stream
  1. The markup. The source text and the page share one box. The page carries fx="page-peel", so the fx library moves it into a canvas.
  2. The layout. The page scrolls inside a box one screen tall.
  3. Starting the page. Load the fx library and make the page peel.
  4. The shader. GLSL for WebGL and the same function in WGSL for WebGPU. Where the paper is gone it writes clear pixels.
  5. The same roll as outlines. Script needs to know where the paper is, for input.
  6. Splitting input along the roll. A clip-path on the canvas host, and two more on the handle.
  7. The drag.
  8. The HTML as the server sends it. Read from the response stream, chunk by chunk.
  9. Showing the text as it arrives.
  10. This page's part. Put the text under the page and the numbers in the page.
  11. What the first response did. It can't be read again, but a script in <head> can watch the parser work through it.
  12. Colouring the text.
  13. The blocks that change the page.
  14. The canvas inside the page.
  15. Counting frames on the device.
  16. Inside the fx library: the upload and the draw.

How it works

  • The document doesn't scroll. #sheet is a scrolling box as tall as the window below the menu bar, and it holds everything from the banner to the findings. The fx library wraps it in <fx-surface>, whose shadow root holds a canvas with content="drawable". The canvas is one screen in size whatever the length of the page.
  • The effect page-peel is one fragment shader. It gets the picture of the page and one point, the position of the paper's corner, from the CSS properties --fx-x and --fx-y. It rolls the paper round a cylinder that lies across the direction the corner has travelled, and draws the peeled paper mirrored and faded on top of the page. Where no paper is left it writes transparent pixels and a shadow.
  • The layer under the page is ordinary DOM below the canvas: a scrolling box of text lines with no controls. It's seen through the transparent pixels.
  • Transparent pixels still take input. A clip-path polygon on the canvas host, computed in script from the same numbers as the shader, cuts the canvas along the roll. Taps, scrolling and text selection beyond it go to the source text.
  • The paper lying on the page is pixels. The part of the page under it would take the tap. A handle element with the same outline lies over it and takes the drag instead. A round button on the paper's corner does the same job for a keyboard: Enter peels the page and puts it back, Escape puts it back.
  • "Take the page off" rolls the page into the bottom left corner. The roll stays there to be pressed, because the layer under the page has no button of its own.
  • The text is a second fetch() of this address with cache: 'no-store', read from response.body chunk by chunk and shown after each chunk. The first response, the one the parser read, can't be read again from script. Its byte count is in performance.getEntriesByType('navigation') and is compared with the second.
  • A script in <head> records each batch of nodes the parser adds while that first response arrives. The bars under "What the server sent" are those batches.

Live checks

Each check builds its own fixture in a corner of the window. The page isn't peeled or changed by them.

ResultExperimentDetail

Findings

From Chromium 157 with software rendering, 412 px wide, on 2026-11-22. The rows above say what your browser does.

On this device: move the paper and scroll the page, and the number of frames the canvas drew is written here.

  • Works: one canvas draws a whole scrolling page. The page is a scrolling box inside the canvas. Scrolling it by touch, by wheel and from script raises a new frame, and elements are found at their scrolled positions. At 412 px wide and scale 2.625 the canvas is 2.24 megapixels, whatever the length of the page.
  • Works: a clip-path on the canvas host splits input along the roll. A shader can make pixels transparent but the element behind them still takes the tap. With the host clipped, elementFromPoint() gives the layer under the page, and a touch swipe there scrolls the source and not the page.
  • Works: the text is the server's. The second request returned the same number of bytes as the response the parser read (the navigation timing entry). The text doesn't change when the page does.
  • Works: a drawable canvas inside the drawn page. The inner canvas is in the outer picture and its button takes a tap. It needs contain: paint.
  • Works: the same picture on WebGL and WebGPU. Drawn into a texture with a software WebGPU adapter, the WGSL differs from the GLSL by 0.08 of 255 per channel on average.
  • Limit: the response that made the page can't be read again. Script gets its size and timing, and can watch the parser add nodes, but the text has to come from a second request. If the server answers differently the second time, the second answer is shown. The page compares the byte counts and says when they differ.
  • Limit: the test server sent the page in one chunk. The text is shown after every chunk, so a response in several chunks would be seen arriving. That was not seen here.
  • Not verified here: the WebGPU route on a screen, and how many frames a second a phone draws while the paper is dragged and while the page scrolls. The line above this list reports both on the device that opens the page. Also open on a phone: text selection handles in the source text, and the on-screen keyboard over a document that doesn't scroll, and how many chunks the deployed server sends.