var elm = document.querySelector("#frame");
// Set a zero-margin displayport to ensure that the element is async-scrollable
utils.setDisplayPortMarginsForElement(0, 0, 0, 0, elm, 0);
elm.scrollTop = 0;
// Take over control of the refresh driver and don't allow a layer
// transaction until the main thread and APZ have processed two different
// scrolls.
await promiseApzFlushedRepaints();
utils.advanceTimeAndRefresh(0);
// Scroll instantly on the main thread by (0, 100).
elm.scrollBy(0, 100);
// We are not using `scroll-behavior`
is(elm.scrollTop, 100, "the main thread scroll should be instant");
// Dispatch a wheel event to have APZ scroll by (0, 8). Wait for the wheel
// event to ensure that the APZ has processed the scroll.
await promiseNativeWheelAndWaitForWheelEvent(elm, 40, 40, 0, -8);
// APZ should be handling the wheel scroll
is(elm.scrollTop, 100, "the wheel scroll should be handled by APZ");
// Restore control of the refresh driver, allowing the main thread to send a
// layer transaction containing the (0, 100) scroll.
utils.restoreNormalRefresh();
// Wait for all paints to finish and for the main thread to receive pending
// repaint requests with the scroll offset from the wheel event.
await promiseApzFlushedRepaints();
// The main thread scroll should not have overidden the APZ scroll, and we
// should see the effects of both scrolls.
ok(elm.scrollTop > 100, `expected element.scrollTop > 100. got element.scrollTop = ${elm.scrollTop}`);
}
if (isApzEnabled()) {
SimpleTest.waitForExplicitFinish();
// Receiving a relative scroll offset update can cause scroll animations to
// be cancelled. This should be fixed, but for now we can still test this
// by disabling smooth scrolling.
pushPrefs([["general.smoothScroll", false]])
.then(waitUntilApzStable)
.then(test)
.then(SimpleTest.finish, SimpleTest.finishWithFailure);
}
</script>
</body>
</html>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-08-26)
¤
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.