Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/the-img-element/sizes/sizes-auto-rendering.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html class="reftest-wait">
<title>Auto sizes rendering</title>
<link rel="match" href="reference/sizes-auto-rendering-ref.html">
<script src="/common/rendering-utils.js"></script>
<script src="/common/reftest-wait.js"></script>
<img
id="testImg"
loading="lazy"
sizes="auto"
width="33"
height="13"
>
<script>
function imageLoaded() {
waitForAtLeastOneFrame().then(takeScreenshot);
}
testImg.addEventListener('load', imageLoaded);
testImg.setAttribute('srcset', `
/images/fail.gif 10w,
/images/green.png 100w,
/images/red.png 1000w
`);
</script>