diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /layout/reftests/async-scrolling/disable-apz-for-sle-pages.html | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | layout/reftests/async-scrolling/disable-apz-for-sle-pages.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/layout/reftests/async-scrolling/disable-apz-for-sle-pages.html b/layout/reftests/async-scrolling/disable-apz-for-sle-pages.html new file mode 100644 index 0000000000..8db572f7a7 --- /dev/null +++ b/layout/reftests/async-scrolling/disable-apz-for-sle-pages.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html class="reftest-wait reftest-snapshot-all reftest-no-flush" reftest-async-scroll + reftest-async-scroll-y="200"> + <head> + <title>Check that the apz.disable_for_sle_pages pref behaves as expected</title> + <script> + // Upon load, this page invokes scrollTo() for a transparent element + // repeatedly. It triggers scroll events, which run the scroll listener + // below. The scroll listener updates the background-position-x of the div + // to make the div a scroll-linked-effect. The scroll-linked effect detector + // should then report that the document contains such an effect, which will + // disable APZ on the page. That in turn will cause the + // reftest-async-scroll-y to get ignored, and that's what the reftest checks + // for. + + function start() { + let scrollPosition = 1; + + scroller.addEventListener('scroll', function() { + // NOTE: Changing background-position-x doesn't change rendering for + // this element. + document.getElementById('scroll-linked-effect').style.backgroundPositionX = + scroller.scrollTop + "px"; + if (scrollPosition == 1) { + setTimeout(done, 0); + } + scrollPosition++; + scroller.scrollTo(0, scrollPosition); + }); + + scroller.scrollTo(0, scrollPosition); + } + addEventListener('load', start, false); + + function done() { + document.documentElement.classList.remove('reftest-wait'); + } + </script> + </head> + <body style="height: 5000px; background-image:url(repeatable-diagonal-gradient.png);"> + <div id="scroller" style="overflow: auto; width: 100px; height: 100px; scrollbar-width: none;"> + <div style="height: 5000px;"></div> + </div> + <div id="scroll-linked-effect" style="position: absolute; top: 100px; left: 100px; width: 100px; height: 100px; background-color: green"></div> + </body> +</html> |