Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/layout/generic/test/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  frame_visibility_in_iframe.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/layout/generic/test/frame_visibility_in_iframe.html


<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Video element visibility in iframe</title>
</head>
<body>
<div style="width: 100%; height: calc(100vh - 100px);"></div>
<div style="height: 100px; overflow: scroll;">
  <!-- 2x height of the scroll port to make this test pass with/without Fission -->
  <div style="width: 100%; height: 200px;"></div>
  <iframe id="iframe" style="height: 100px; border: none;"></iframe>
</div>
<script>
const add_task = window.opener.add_task;
const SimpleTest = window.opener.SimpleTest;
const original_finish = window.opener.SimpleTest.finish;

// add_task calls SimpleTest.finish() when it finished, we want to close this
// window before SimpleTest.finish() gets called.
SimpleTest.finish = function finish() {
  self.close();
  original_finish();
}

add_task(async () => {
  const iframe = document.getElementById("iframe");
  await new Promise(resolve => {
    iframe.addEventListener("load", () => { resolve(); }, { once: true });
    iframe.src = "http://example.org/tests/layout/generic/test/frame_visibility_in_iframe_child.html";
  });

  await SpecialPowers.spawn(iframe, [], async () => {
    // With layout.visibility.min-recompute-interval-ms=0 value, flushing layout
    // and waiting two frames would be sufficient to make sure at least one
    // RebuildApproximateFrameVisibility call was done. This would avoid the
    // situation we consider the video element is invisible without doing any
    // frame visibility tracking stuff.
    content.document.documentElement.getBoundingClientRect();
    await new Promise(resolve => content.window.requestAnimationFrame(resolve));
    await new Promise(resolve => content.window.requestAnimationFrame(resolve));
  });

  await SpecialPowers.spawn(iframe, [], async () => {
    const video = content.document.querySelector("video");
    Assert.ok(!SpecialPowers.wrap(video).isInViewPort,
              "The video element should not be in the viewport");
  });
});
</script>
</body>
</html>

Messung V0.5
C=71 H=97 G=84

¤ Dauer der Verarbeitung: 0.0 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.