haikuwebkit/LayoutTests/fast/images/decode-decoding-attribute-a...

21 lines
711 B
HTML

<body>
<p>This test ensures if the src of an image with decoding="async" is set to the src of a decoded image, no further decoding will be requested.</p>
<img decoding="async">
<script>
(function() {
if (window.internals && window.testRunner) {
internals.clearMemoryCache();
testRunner.waitUntilDone();
}
var image = new Image;
image.src = "resources/green-400x400.png";
image.decode().then(() => {
document.querySelector("img").src = image.src;
if (window.testRunner)
testRunner.notifyDone();
});
})();
</script>
</body>