Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  file_zoom_restore_bfcache.html

  Sprache: HTML
 

 products/Sources/formale Sprachen/C/Firefox/layout/base/tests/file_zoom_restore_bfcache.html


<!doctype html>
<script>
  var bcName = "zoomRestoreBfcache" + window.location.search;
  var bc = new BroadcastChannel(bcName);
  if (window.location.search == "?2") {
    bc.onmessage = (msgEvent) => {
      var msg = msgEvent.data;
      var command = msg.command;
      dump(`Subpage ?2 received command=${command}\n`);
      switch (command) {
        case "case2sendData": {
          bc.postMessage({command"case2data", devicePixelRatio: window.devicePixelRatio,
            frameDevicePixelRatio: document.querySelector("iframe").contentWindow.devicePixelRatio});
          break;
        }
        case "case2action": {
          SpecialPowers.spawnChrome([], () => {
            const FullZoom = this.browsingContext.embedderElement.ownerGlobal.FullZoom;
            FullZoom.setZoom(2.0);
          });
          SpecialPowers.setFullZoom(window, 2);
          window.requestAnimationFrame(() => window.requestAnimationFrame(() => {
            bc.postMessage({command"case2dataAnimationFrame", devicePixelRatio: window.devicePixelRatio,
            frameDevicePixelRatio: document.querySelector("iframe").contentWindow.devicePixelRatio });
          }));
          break;
        }
        case "case2back": {
          bc.close();
          window.history.back();
          break;
        }
      }
    }
  } else {
    bc.onmessage = (msgEvent) => {
      var msg = msgEvent.data;
      var command = msg.command;
      dump(`Subpage received command=${command}\n`);
      switch (command) {
        case "case1sendData": {
          bc.postMessage({command"case1data", devicePixelRatio: window.devicePixelRatio});
          break;
        }
        case "case1click": {
          document.querySelector("a").click();
          // We are opening file_zoom_restore_bfcache.html?2, so the current
          // page is going into bfcache
          break;
        }
        case "case3sendData": {
          // We came back from bfcache
          SpecialPowers.spawnChrome([], () => {
            // We use FullZoom to set the zoom level in the parent, but if FullZoom is not
            // available then that will fail. So we don't wait here for the devicePixelRatio
            // to change if FullZoom is not available, and test_zoom_restore_bfcache.html
            // will mark this test as todo.
            return "FullZoom" in this.browsingContext.embedderElement.ownerGlobal;
          }).then((hasFullZoom) => {
            function waitUntilZoomLevelRestored() {
              // Zoom level is updated asynchronously when bfcache lives in the
              // parent process.
              if (!hasFullZoom || window.devicePixelRatio == 2) {
                bc.postMessage({command"case3data", devicePixelRatio: window.devicePixelRatio,
                frameDevicePixelRatio: document.querySelector("iframe").contentWindow.devicePixelRatio});
                return;
              }
              window.requestAnimationFrame(waitUntilZoomLevelRestored);
            }
            window.requestAnimationFrame(waitUntilZoomLevelRestored);
          });
          break;
        }
        case "close": {
          SpecialPowers.spawnChrome([], () => {
            const FullZoom = this.browsingContext.embedderElement.ownerGlobal.FullZoom;
            FullZoom.setZoom(1.0);
          });
          bc.postMessage({command"closed"});
          bc.close();
          window.close();
          break;
        }
      }
    }
  }
  window.addEventListener("pageshow", function(e) {
    bc.postMessage({command"handlePageShow", eventPersisted: e.persisted});
  });
</script>
<a href="?2">This is a very interesting page</a>
<iframe srcdoc="And this is a nested frame"></iframe>

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

¤ Dauer der Verarbeitung: 0.19 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© 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

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik