layout/reftests/scrolling/fixed-opacity-2.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/scrolling/fixed-opacity-2.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<body style="height:2000px; margin:0; overflow:hidden">
     1.7 +<div style="height:1000px; background:url(repeatable-diagonal-gradient.png) fixed repeat-x; opacity:0.5"></div>
     1.8 +<script type="application/javascript">
     1.9 +var topElements = document.getElementsByClassName("scrollTop");
    1.10 +if (!topElements.length) {
    1.11 +  topElements = [document.documentElement];
    1.12 +}
    1.13 +
    1.14 +var failed = false;
    1.15 +
    1.16 +function doScroll(d)
    1.17 +{
    1.18 +  if (failed)
    1.19 +    return;
    1.20 +  for (var i = 0; i < topElements.length; ++i) {
    1.21 +    var e = topElements[i];
    1.22 +    e.scrollTop = d;
    1.23 +    if (e.scrollTop != d) {
    1.24 +      document.documentElement.textContent =
    1.25 +          "Scrolling failed on " + e.tagName + " element, " +
    1.26 +          "tried to scroll to " + d + ", got " + e.scrollTop +
    1.27 +          " (Random number: " + Math.random() + ")";
    1.28 +      failed = true;
    1.29 +    }
    1.30 +  }
    1.31 +}
    1.32 +
    1.33 +if (document.location.search == '?ref') {
    1.34 +  doScroll(700);
    1.35 +} else {
    1.36 +  doScroll(800);
    1.37 +  document.documentElement.setAttribute("class", "reftest-wait");
    1.38 +  window.addEventListener("MozReftestInvalidate", function() {
    1.39 +    document.documentElement.removeAttribute("class");
    1.40 +    doScroll(700);
    1.41 +  }, false);
    1.42 +}
    1.43 +</script>
    1.44 +</body>
    1.45 +</html>

mercurial