Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/common/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  worklet-reftest.js   Sprache: JAVA

 

/**
 * Imports code into a worklet. E.g.
 *
 * importWorklet(CSS.paintWorklet, {url: 'script.js'});
 * importWorklet(CSS.paintWorklet, '(javascript string)');
 *
 * @param {Worklet} worklet
 * @param {(Object|string)} code
 */

function importWorklet(worklet, code) {
    let url;
    if (typeof code === 'object') {
      url = code.url;
    } else {
      const blob = new Blob([code], {type: 'text/javascript'});
      url = URL.createObjectURL(blob);
    }

    return worklet.addModule(url);
}

/** @private */
async function animationFrames(frames) {
  for (let i = 0; i < frames; i++)
    await new Promise(requestAnimationFrame);
}

// This ensures that a commit is accepted and drawn by waiting for a
// composited animation to start.
/** @private */
async function workletPainted() {
  const animation =
    document.body.animate({ opacity: [0, 1] }, { duration: 1 });
  return animation.finished;
}

/**
 * To make sure that we take the snapshot at the right time, we start a
 * composited animation. Once the composited animation runs we know that
 * an updated composited frame has been produced.
 *
 * @param {Worklet} worklet
 * @param {(Object|string)} code
 */

async function importWorkletAndTerminateTestAfterAsyncPaint(worklet, code) {
    if (typeof worklet === 'undefined') {
        takeScreenshot();
        return;
    }

    await importWorklet(worklet, code);
    await workletPainted();
    takeScreenshot();
}

Messung
CHZG
849910094

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

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.