var tests = [
function() {
ok(true, "Setting location.hash should scroll.");
nextTest();
// Click the top scroll arrow. var x = scroller.getBoundingClientRect().width - 5; var y = 5;
// On MacOSX the top scroll arrow can be below the slider just above
// the bottom scroll arrow.
if (navigator.platform.includes("Mac"))
y = scroller.getBoundingClientRect().height - 40;
synthesizeMouse(scroller, x, y, { type : "mousedown" }, window);
synthesizeMouse(scroller, x, y, { type: "mouseup" }, window);
},
function() {
ok(true, "Clicking the top scroll arrow should scroll.");
nextTest();
// Click the bottom scroll arrow. var x = scroller.getBoundingClientRect().width - 5; var y = scroller.getBoundingClientRect().height - 25;
synthesizeMouse(scroller, x, y, { type : "mousedown" }, window);
synthesizeMouse(scroller, x, y, { type: "mouseup" }, window);
},
function() {
ok(true, "Clicking the bottom scroll arrow should scroll.");
nextTest();
// Click the scrollbar. var x = scroller.getBoundingClientRect().width - 5;
synthesizeMouse(scroller, x, 40, { type : "mousedown" }, window);
synthesizeMouse(scroller, x, 40, { type: "mouseup" }, window);
},
function() {
ok(true, "Clicking the scrollbar should scroll");
nextTest();
// Click the scrollbar. var x = scroller.getBoundingClientRect().width - 5; var y = scroller.getBoundingClientRect().height - 50;
synthesizeMouse(scroller, x, y, { type : "mousedown" }, window);
synthesizeMouse(scroller, x, y, { type: "mouseup" }, window);
},
function() {
scroller.onscroll = null;
ok(true, "Clicking the scrollbar should scroll");
finish();
}
];
document.onmousedown = function () { return false; };
document.onmouseup = function () { return true; };
var scroller; var timer = 0;
function failure() {
ok(false, scroller.onscroll + " did not run!");
scroller.onscroll = null;
finish();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.