Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/gfx/layers/apz/test/mochitest/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 2 kB image not shown  

Quelle  helper_bug1783936.html   Sprache: HTML

 
 products/sources/formale Sprachen/C/Firefox/gfx/layers/apz/test/mochitest/helper_bug1783936.html


<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Test that scroll snap happens on pan end without fling</title>
  <script src="apz_test_utils.js"></script>
  <script src="apz_test_native_event_utils.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <style>
    body {
      margin: 0;
      padding: 0;
    }
    html {
      overflow-y: scroll;
      scroll-snap-type: y mandatory;
      scroll-behavior: auto;
    }
    .snap {
      width: 100%;
      height: 100vh;
      background-color: blue;
      position: absolute;
      top: 200px;
      scroll-snap-align: start;
    }
  </style>
</head>
<body>
  <div class="snap"></div>
  <div style="width: 100%; height: 500vh;"></div>
  <script type="application/javascript">
    async function test() {
      is(window.scrollY, 200, "The initial layout should result snapping to 200px");

      // Start scrolling back by a pan gesture and wait its' scroll end.
      let transformEndPromise = promiseTransformEnd();
      await promiseNativeTouchpadPanEventAndWaitForObserver(
        window,
        100,
        100,
        0, -100,
        SpecialPowers.DOMWindowUtils.PHASE_BEGIN);

      // Finish the pan gesture.
      await promiseNativeTouchpadPanEventAndWaitForObserver(
        window,
        100,
        100,
        0, 0,
        SpecialPowers.DOMWindowUtils.PHASE_END);
      await transformEndPromise;

      // Make sure the new scroll positions have reached to the main-thread.
      await promiseOnlyApzControllerFlushed();

      is(window.scrollY, 200, "The pan-end should result snapping to 200px");
    }

    // This test is supposed to run on environments where
    // PanGestureInput.mSimulateMomentum for pan gestures is true, which means
    // as of now it's only on Linux.
    if (getPlatform() == "linux") {
      waitUntilApzStable()
      .then(test)
      .then(subtestDone, subtestFailed);
    } else {
      ok(true, "Skipping test because this test isn't supposed to work on " + getPlatform());
      subtestDone();
    }
  </script>
</body>
</html>

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

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

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