2 <script src=
"../../resources/js-test.js"></script>
3 <body style=
"min-width: 5000px; min-height: 5000px">
5 description('Checks that the scroll event fires on the document asychronously and only once.');
10 onscroll = function(event
)
13 if (eventCount
== 1) {
14 debug('Scroll event bubbles: ' + event
.bubbles
);
15 var scrollX
= document
.scrollingElement
.scrollLeft
;
16 var scrollY
= document
.scrollingElement
.scrollTop
;
17 testPassed('Scroll position: (' + scrollX
+ ', ' + scrollY
+ ')');
18 // Don't call notifyDone straight away, in case there's another scroll event coming.
19 doneTimeout
= setTimeout(finishJSTest
, 100);
21 clearTimeout(doneTimeout
);
22 testFailed('Scroll handler was invoked ' + eventCount
+ ' times');
29 window
.scrollTo(100, 100);
31 testFailed('Scroll event fired synchronously');
34 window
.scrollTo(200, 200);
36 var jsTestIsAsync
= true;