disable-apz-for-sle-pages.html 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. <!DOCTYPE html>
  2. <html class="reftest-wait reftest-snapshot-all reftest-no-flush" reftest-async-scroll
  3. reftest-async-scroll-y="200">
  4. <head>
  5. <title>Check that the apz.disable_for_sle_pages pref behaves as expected</title>
  6. <script>
  7. // Upon load, this page scrolls to (0, 100). This triggers a scroll event,
  8. // which runs the scroll listener below. The scroll listener updates the
  9. // position of the div to simulate position:fixed using a scroll-linked
  10. // effect. The scroll-linked effect detector should then report that the
  11. // document contains such an effect, which will disable APZ on the page.
  12. // That in turn will cause the reftest-async-scroll-y to get ignored, and
  13. // that's what the reftest checks for.
  14. addEventListener('scroll', function() {
  15. document.getElementById('fake-fixed').style.top = window.scrollY + "px";
  16. }, false);
  17. addEventListener('load', function() {
  18. window.scrollTo(0, 100);
  19. setTimeout(done, 0);
  20. }, false);
  21. function done() {
  22. document.documentElement.classList.remove('reftest-wait');
  23. }
  24. </script>
  25. </head>
  26. <body style="height: 5000px; background-image:url(repeatable-diagonal-gradient.png);">
  27. <div id="fake-fixed" style="position: absolute; top: 0; left: 100px; width: 100px; height: 100px; background-color: green"></div>
  28. </body>
  29. </html>