blob: e54ae223a0014f8cd20d35af45dbddb33e043e32 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<!DOCTYPE html>
<title>HTMLImageElement.prototype.decode(), image document tests.</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="frame_imgdoc" src="about:blank"></iframe>
<script>
"use strict";
promise_test(function() {
return new Promise(function(resolve) {
var frame = document.getElementById("frame_imgdoc");
// Load an image in the iframe and then replace that.
frame.src = "/images/red.png";
frame.onload = function() {
let img = frame.contentDocument.body.firstElementChild;
img.src = "/images/green.png";
img.decode().then(function() {
resolve();
});
};
});
}, document.title + " Decode from iframe with image document, succeeds (img not loaded)");
</script>
|