gecko/layout/reftests/scrolling/scrolling.js
2010-06-18 21:18:42 +12:00

23 lines
539 B
JavaScript

var topElements = document.getElementsByClassName("scrollTop");
if (!topElements.length) {
topElements = [document.body];
}
function doScroll(d)
{
for (var i = 0; i < topElements.length; ++i) {
topElements[i].scrollTop = d;
}
}
if (document.location.search == '?ref') {
doScroll(20);
} else {
doScroll(1);
document.documentElement.setAttribute("class", "reftest-wait");
window.addEventListener("MozReftestInvalidate", function() {
document.documentElement.removeAttribute("class");
doScroll(20);
}, false);
}