Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/image/test/reftest/ico/ico-bmp-corrupted/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  wrapper.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/image/test/reftest/ico/ico-bmp-corrupted/wrapper.html


<!DOCTYPE HTML>
<html class="reftest-wait">
<head>
<title>Image reftest wrapper</title>
<style type="text/css">
  #image1 { background-color: rgb(10, 100, 250); }
</style>
<script>
  var gImg;

  function runAfterAsyncEvents(aCallback) {
    function handlePostMessage(aEvent) {
      if (aEvent.data == 'next') {
        window.removeEventListener('message', handlePostMessage);
        aCallback();
      }
    }

    window.addEventListener('message', handlePostMessage);

    // We'll receive the 'message' event after everything else that's currently in
    // the event queue (which is a stronger guarantee than setTimeout, because
    // setTimeout events may be coalesced). This lets us ensure that we run
    // aCallback *after* any asynchronous events are delivered.
    window.postMessage('next''*');
  }

  // The image is loaded async after the page loads
  // wait for it to finish loading
  function onImageLoad() { 
    // Use a canvas to force the image to get sync decoded.
    var canvas = document.createElement('canvas');
    var ctx = canvas.getContext('2d');

    try {
      ctx.drawImage(gImg, 0, 0);
    } catch (e) {
    }

    // Continue after pumping the event loop.
    runAfterAsyncEvents(step2);
  }

  function step2() {
    // Only now, once the image has already been sync decoded, do we load it in
    // the <img> element we're going to snapshot. That's because for some of the
    // tests that use wrapper.html, an error is only detected when decoding the
    // actual image data - i.e., the error isn't detected in the header. The
    // precise time when we detect the error, unfortunately, affects how we draw
    // the image. This will be fixed in bug 1182531, and then we can simplify this
    // code.

    var finalImg = document.getElementById('image1');
    finalImg.onload = finalImg.onerror = step3;
    finalImg.src = gImg.src;
  }

  function step3() {
    // We're ready to take the snapshot, but pump the event loop first just to
    // be sure that everything has settled down.
    runAfterAsyncEvents(takeSnapshot);
  }

  function takeSnapshot() {
    document.documentElement.removeAttribute("class");
  }
</script>
</head>
<body>
<!-- non-empty alt to avoid the broken image icon -->
<img id="image1" alt=" ">
<script>
  // Use as "wrapper.html?image.png
  gImg = document.createElement('img');
  gImg.onload = gImg.onerror = onImageLoad;
  gImg.src = document.location.search.substr(1);
</script>
</body>
</html>


Messung V0.5
C=99 H=100 G=99

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.