img.src reassignment should not trigger an extra fetch

#486562295 Filed 2026-02-23 Status: New

Summary

Spec behavior: assigning the same img.src value should reuse the currently available image.

Bug behavior (before fix): Blink performs an extra fetch when src is reassigned to the same URL for Cache-Control: no-store images.

Reproducer

1) Click Run Reproducer.

2) The script loads an image, records width, reassigns the same src, then checks width again.

Expected: width1 == width2. Actual (bug): width changes due to an extra fetch.

Open WPT test

Code

const runId = Math.random().toString(36).slice(2);
const url = `https://wpt.live/html/semantics/embedded-content/the-img-element/resources/image-alternate-no-store.py?run=${runId}`;
const img = document.createElement('img');
img.src = url;
await img.decode();
const width1 = img.naturalWidth;
img.src = img.src;
await img.decode();
const width2 = img.naturalWidth;
console.log({width1, width2});

Links

Chromium issue 486562295

WPT reference test