blob: c406013970eee4ff236bedcf723a839cdeef619d [file] [log] [blame]
<html>
<script src="../js/resources/js-test-pre.js"></script>
<body style="min-height: 2000px">
<script type="text/javascript">
description('Tests that we can listen for scroll events on the document in both the capture and bubble phases.');
var triggeredCaptureListener = false;
var triggeredBubbleListener = false;
window.addEventListener(
'scroll',
function() {
triggeredCaptureListener = true;
checkComplete();
},
true);
window.addEventListener(
'scroll',
function(event) {
triggeredBubbleListener = true;
checkComplete();
},
false);
function checkComplete()
{
if (triggeredCaptureListener && triggeredBubbleListener) {
debug('Both capture and bubble phase listeners were invoked.');
finishJSTest();
}
}
window.scrollTo(200, 200);
var successfullyParsed = true;
var jsTestIsAsync = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>