summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/animation/request-animation-frame-within-callback.html
blob: d5a366fee0458343945d00fc965ae859d5352aa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<span id="e">FAIL</span>
<script>
if (window.layoutTestController)
    layoutTestController.dumpAsText();

var e = document.getElementById("e");
var sameFrame;
window.webkitRequestAnimationFrame(function() {
    sameFrame = true;
}, e);
window.webkitRequestAnimationFrame(function() {
    window.webkitRequestAnimationFrame(function() {
        e.innerHTML = sameFrame ? "FAIL" : "PASS";
    }, e);
}, e);
window.webkitRequestAnimationFrame(function() {
    sameFrame = false;
}, e);

// This should fire the three already registered callbacks, but not the one dynamically registered.
if (window.layoutTestController)
    layoutTestController.display();
// This should fire the dynamically registered callback.
if (window.layoutTestController)
    layoutTestController.display();
</script>