<!DOCTYPEHTML>
<html> <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=731419
-->
<head>
<title>Test for Bug 731419 - Draw an ostensibly discarded image to a canvas</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<!-- Load an image in an iframe, then draw that image to a canvas. Then set the iframe to display:none (after bug 731419, this causes the image's decoded data to be discarded) and draw the image to a canvas again. We should draw the same image data both times.
-->
<script>
SimpleTest.waitForExplicitFinish();
var data1;
function drawImage()
{ varcanvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var iframeDoc = document.getElementById('iframe').contentDocument;
function iframeLoad()
{
data1 = drawImage();
document.getElementById('iframe').style.display = 'none';
// Spin the event loop a few times to give the image in the display:none
// iframe a chance to be discarded.
SimpleTest.executeSoon(function() {
SimpleTest.executeSoon(function() {
SimpleTest.executeSoon(function() {
step2();
});
});
});
}
function step2()
{
is(drawImage(), data1, "Same image before and after iframe display:none");
SimpleTest.finish();
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.38Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.