import type { Diagnostic } from '@variance-authority/core/format'; /** * Images a page made from bytes it held, carried as those bytes. * * A page that computes an image — a canvas encoded to a blob, a file the user * dropped, a response read as a blob — shows it through an object URL, * `blob:/`. That URL names memory in the document that minted * it, and nothing else can resolve it. The deferred renderer paints the render * document in a page of its own, so a document that carried the URL painted a * broken image where the page showed a picture; and the uuid is new on every * load, so one picture acquired twice was two documents, and `settle` never * found the baseline's digest again. * * So each object URL the document would carry is read here, in the page that * can still read it, and written into the document as a `data:` URL of the * same bytes. The document then holds what the image shows, and its * digest moves when the picture does and only then. `referencedAssets` leaves * `data:` out of the asset key for that reason: the bytes are in the document. * * The read is a synchronous request, because acquisition is one synchronous * pass and an object URL is answered from memory. Its response is taken as * `x-user-defined` text, the one way a synchronous request in a window hands * back bytes, since a window refuses it a `responseType`. * * An object URL nothing can read — revoked after the image loaded, or in a * host with no request — keeps its URL. In a host that paints, it is an * `error`: the render paints that image broken where the page shows it whole, * and a comparison of the two would agree with a picture nobody saw. A host * that paints nothing, such as jsdom, mints no object URLs either, so the URL is * a string a test wrote and no page showed its picture; that is the host's * standing limit, and a `warn`, as an unread font face is. */ /** One attribute of one element, as the render document must write it. */ export interface AttributeEdit { readonly name: string; readonly namespace: string | null; readonly value: string; } /** The text a `