Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  test_drawSnapshot_fixed.html   Sprache: HTML

 

 products/Sources/formale Sprachen/C/Firefox/dom/canvas/test/test_drawSnapshot_fixed.html


<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <title>Test for drawSnapshot</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/WindowSnapshot.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <style>
    html {
      height: 2000px;
      overflow: hidden;
    }
    header {
      position: fixed;
      background: red;
      display: block;
      left: 0;
      right: 0;
      top: 0;
      height: 200px;
    }
  </style>
  <script type="application/javascript">
  function make_canvas() {
    var canvas = document.createElement("canvas");
    canvas.setAttribute("height", 2000);
    canvas.setAttribute("width", 500);
    return canvas;
  }

  SimpleTest.waitForExplicitFinish();
  window.addEventListener("load", runTests);
  
  window.scrollTo(0, 1000);

  async function runTests(event) {
    var testCanvas = make_canvas();
    var testCx = testCanvas.getContext("2d");
    var testWrapCx = SpecialPowers.wrap(testCx);

    // Take a snapshot of the page while scrolled down, so that the fixed header will
    // be visually in the middle of the root scroll frame, but should still be at the
    // top of the snapshot (since snapshots with a rect are taken relative to the document).
    var rect = new window.DOMRect(0, 0, 500, 2000);
    let image = await SpecialPowers.snapshotContext(window, rect, "rgb(255, 255, 255)", true);
    testWrapCx.drawImage(image, 0, 0);

    var refCanvas = make_canvas();
    var refCx = refCanvas.getContext("2d");

    // Construct a reference image with an equivalent red square at the top.
    refCx.fillStyle = "white";
    refCx.fillRect(0, 0, 500, 2000);
    refCx.fillStyle = "red";
    refCx.fillRect(0, 0, 500, 200);

    assertSnapshots(testCanvas, refCanvas, true, null, "position:fixed element with scrolling", "reference");

    SimpleTest.finish();
  }

  </script>
</head>
<body>
  <header></header>
</body>
</html>

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.20 Sekunden  (vorverarbeitet am  2026-09-30) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=1897691