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

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

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

mercurial