blob: 7bbae88e78375e365e55aaebdf5d3e5a71d49b12 [file] [log] [blame]
<!DOCTYPE html>
<title>Canvas test: 2d.drawImage.animated.poster</title>
<script src="../tests.js"></script>
<link rel="stylesheet" href="../tests.css">
<body>
<p id="passtext">Pass</p>
<p id="failtext">Fail</p>
<p class="output">These images should be identical:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
<ul id="d"></ul>
<script>
_addTest(function(canvas, ctx) {
// This test is disabled because it is wrong. It expects to draw the IDAT frame
// of an animated PNG in which the IDAT frame is not part of the animation. This
// should only happen if we do *not* support APNG. Now that we support APNG,
// this test fails.
//
// The ImageDecoder is not aware of what method is requesting the decode, and
// the APNG specification [1] does explicitly state that the IDAT is not part
// of the animated image if there's no fcTL chunk preceding it. It would make
// more sense if this test would verify that the first frame of the image is
// drawn, but that is explicitly not the purpose, as stated at [2]. In Firefox,
// the developer of the APNG specification, this test [2] fails too.
//
// [1] https://wiki.mozilla.org/APNG_Specification
// [2] http://www.w3c-test.org/2dcontext/drawing-images-to-the-canvas/2d.drawImage.animated.apng.html
_assertSame("disabled", "disabled", "disabled", "disabled");
// ctx.drawImage(document.getElementById('anim-poster-gr.png'), 0, 0);
// _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
});
</script>
<img src="../images/anim-poster-gr.png" id="anim-poster-gr.png" class="resource">