v152 · ua image replacement
What breaks without them
Suppose a browser replaced an image and told nobody. Could a page work it out anyway? This asks every property an image exposes, against a real image, and the answer is the argument for the feature: almost none of it would change.
Everything a page can observe about an image
| what a page can read | value here | changes on replacement? | why |
|---|---|---|---|
| Not read yet. | |||
The "changes?" column is reasoning, not measurement — no browser here replaces images, so nothing can be observed changing. What is measured is the left-hand side: every one of those properties is read from a real loaded image, so the list of what a page has to work with is complete and current.
The one thing that would change
The pixels. A page can read them back through a canvas — and for a same-origin image, that works. Whether it would notice a replacement depends on being able to compare against something, which means storing a hash of every image you ship and checking it on every load.
This works, and it is not a solution. It costs a canvas draw and a read-back per image, it fails for cross-origin images because the canvas is tainted, and it tells you that something changed rather than that the browser changed it deliberately at the user's request — which are very different things to respond to.
The furniture that becomes wrong
| element | what it asserts | after a replacement |
|---|