Files
palemoon27/layout/base/tests/test_scroll_event_ordering.html
T
roytam1 dd3d18022d import changes from `dev' branch of rmottola/Arctic-Fox:
- include limits for  numeric_limits in gcc 11 (e46f1407b)
- Bug 1201057 - Move AutoEnterOOMUnsafeRegion to Utility.h with the other OOM simulation infrastructure r=terrence (ba11ded16)
- Bug 1189490 - Part 0: Add a FIFO queue container type to js/public. r=terrence (97bd6e58d)
- Bug 1189490 - Part 1: Add a JS::Traceable version of the FIFO queue for use with GC things. r=terrence (0e397ee31)
- Bug 1144797 - Add setInterval and clearInterval to Timer.jsm. r=smacleod. (8aee45f35)
- Bug 1182316: Part 3 - Add assertions to most other WebIDL entry points, clean up nsIDOMJSWindow cruft. r=peterv (d2af349b5)
- Bug 1181762. Remove uses of mozRequestAnimationFrame from toolkit code. r=gijs (c5d4fe108)
- Bug 1181765. Remove uses of mozRequestAnimationFrame from layout tests. r=bkelly (bd0b1300b)
- Bug 1181966. Remove uses of mozRequestAnimationFrame from browser code. r=gijs,paul (64ce1b945)
- Bug 909154. Remove the prefixed mozRequestAnimationFrame and its accoutrements. r=bkelly (0257521ce)
- Bug 1185028. Fix GCJsonifierMethod to correctly handle worker descriptors. r=nsm (32c80ced6)
- Bug 1181678 - Expose an attribute on DOMWindowUtils to see if APZ is enabled. r=botond (842c775c7)
2021-07-13 16:16:10 +08:00

64 lines
1.8 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=785588
-->
<head>
<title>Test for Bug 785588 --- ordering of scroll-related events</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=785588">Mozilla Bug 785588</a>
<div id="content">
<div id="d" style="border:2px solid black; width:100px; height:100px; overflow:auto">
<div id="inner" style="height:200px;">Hello</div>
</div>
</div>
<pre id="test">
<script>
SimpleTest.waitForExplicitFinish();
var smoothScrollPref = "general.smoothScroll";
var d = document.getElementById("d");
d.scrollTop = 0;
var inner = document.getElementById("inner");
var state = "initial";
function onFrame() {
is(state, "initial", "Must be in initial state");
ok(d.scrollTop > 0, "Must have scrolled by some amount (got " + d.scrollTop + ")");
state = "didOnFrame";
}
function onScroll() {
is(state, "didOnFrame", "Must have got requestAnimationFrame callback already");
ok(d.scrollTop > 0, "Must have scrolled by some amount (got " + d.scrollTop + ")");
SimpleTest.finish();
}
function doTest() {
window.getSelection().collapse(inner.firstChild, 0);
window.requestAnimationFrame(onFrame);
d.onscroll = onScroll;
sendKey("DOWN");
}
function prepareTest() {
// Start the test after we've gotten at least one rAF callback, to make sure
// that rAF is no longer throttled. (See bug 1145439.)
window.requestAnimationFrame(function() {
SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, doTest);
});
}
SimpleTest.waitForFocus(prepareTest);
</script>
</pre>
</body>
</html>