fixed-opacity-2.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE HTML>
  2. <html>
  3. <body style="height:2000px; margin:0; overflow:hidden">
  4. <div style="height:1000px; background:url(repeatable-diagonal-gradient.png) fixed repeat-x; opacity:0.5"></div>
  5. <script type="application/javascript">
  6. var topElements = document.getElementsByClassName("scrollTop");
  7. if (!topElements.length) {
  8. topElements = [document.documentElement];
  9. }
  10. var failed = false;
  11. function doScroll(d)
  12. {
  13. if (failed)
  14. return;
  15. for (var i = 0; i < topElements.length; ++i) {
  16. var e = topElements[i];
  17. e.scrollTop = d;
  18. if (e.scrollTop != d) {
  19. document.documentElement.textContent =
  20. "Scrolling failed on " + e.tagName + " element, " +
  21. "tried to scroll to " + d + ", got " + e.scrollTop +
  22. " (Random number: " + Math.random() + ")";
  23. failed = true;
  24. }
  25. }
  26. }
  27. if (document.location.search == '?ref') {
  28. doScroll(700);
  29. } else {
  30. doScroll(800);
  31. document.documentElement.setAttribute("class", "reftest-wait");
  32. window.addEventListener("MozReftestInvalidate", function() {
  33. document.documentElement.removeAttribute("class");
  34. doScroll(700);
  35. }, false);
  36. }
  37. </script>
  38. </body>
  39. </html>