diff --git a/layout/reftests/scrolling/scrolling.js b/layout/reftests/scrolling/scrolling.js index b7a861274e8..c01369abe51 100644 --- a/layout/reftests/scrolling/scrolling.js +++ b/layout/reftests/scrolling/scrolling.js @@ -1,12 +1,24 @@ var topElements = document.getElementsByClassName("scrollTop"); if (!topElements.length) { - topElements = [document.body]; + topElements = [document.documentElement]; } +var failed = false; + function doScroll(d) { + if (failed) + return; for (var i = 0; i < topElements.length; ++i) { - topElements[i].scrollTop = d; + var e = topElements[i]; + e.scrollTop = d; + if (e.scrollTop != d) { + document.documentElement.textContent = + "Scrolling failed on " + e.tagName + " element, " + + "tried to scroll to " + d + ", got " + e.scrollTop + + " (Random number: " + Math.random() + ")"; + failed = true; + } } } diff --git a/layout/reftests/scrolling/text-1.html b/layout/reftests/scrolling/text-1.html index 0ede92a6fa2..23afe84ce49 100644 --- a/layout/reftests/scrolling/text-1.html +++ b/layout/reftests/scrolling/text-1.html @@ -1,10 +1,10 @@
- -