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 1 kB image not shown  

Quelle  helper_bug1930342.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/gfx/layers/apz/test/mochitest/helper_bug1930342.html


<!DOCTYPE html>
<html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/NativeKeyCodes.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
<script src="apz_test_utils.js"></script>
<script src="apz_test_native_event_utils.js"></script>
<title>What happens if main thread scrolls?</title>
<style>
body {
  margin: 0;
}

.container {
  width: 100vw;
  height: 10vh;
  min-height: 300px;
  display: flex;
}

#stream {
  width: 300px;
  overflow-y: scroll;
}
</style>
<div class="container">
  <div id="stream"></div>
  </div>
</div>
<script>
async function setup() {
  // Setup a scroll container having 50 child elements, and scroll to
  // the bottom.
  for (let i = 0 ; i < 50; i++) {
    const el = document.createElement("div");
    el.style.height = "20px";

    stream.append(el);
  }

  const scrollPromise = promiseOneEvent(stream, "scroll");
  stream.scrollTo(0, stream.scrollHeight);
  await scrollPromise;
  await promiseApzFlushedRepaints();
}

async function test() {
  await setup();

  // Remove the first element so that a scroll anchor adjustment happens,
  // at the same time the scrollable range shrinks.
  stream.firstElementChild.remove();

  await promiseApzFlushedRepaints();

  // The scroll offset on the main-thread is the expected value.
  const expectedScrollOffset = stream.scrollTop;

  // Collect sampled offsets on the compositor.
  const records = collectSampledScrollOffsets(stream);

  ok(records.some(record => SpecialPowers.wrap(record).scrollOffsetY == expectedScrollOffset),
    `There should be ${expectedScrollOffset} in [${records.map(record => SpecialPowers.wrap(record).scrollOffsetY)}]`);
}

waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);
</script>
</html>

Messung V0.5
C=96 H=94 G=94

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