blob: eae5768a9c0e73165e15d745e4fe6bf341ab12e5 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../resources/js-test-pre.js"></script>
<script type="text/javascript">
window.jsTestIsAsync = true;
var initialPosition = 1;
var halfAnimationPeriod = 63;
var fullAnimationPeriod = 123;
function scrollOffsetInitial()
{
var section1 = document.getElementById('marquee');
if (section1.scrollLeft == -initialPosition) {
debug("PASS on initial position");
} else {
debug("FAIL");
debug("ScrollLeft = " + section1.scrollLeft);
debug("ScrollWidth = " + section1.scrollWidth);
finishJSTest();
}
}
function scrollOffsetCompleteCycle()
{
var section1 = document.getElementById('marquee');
if (section1.scrollLeft == -initialPosition) {
debug("PASS on after full cycle completion");
} else {
debug("FAIL");
debug("ScrollLeft = " + section1.scrollLeft);
debug("ScrollWidth = " + section1.scrollWidth);
}
finishJSTest();
}
function scrollOffsetMidCycle()
{
var section1 = document.getElementById('marquee');
if (section1.scrollLeft == 0 ) {
debug("PASS on after half cycle completion");
} else {
debug("FAIL");
debug("ScrollLeft = " + section1.scrollLeft);
debug("ScrollWidth = " + section1.scrollWidth);
finishJSTest();
}
}
function dump() {
var t=setTimeout("scrollOffsetInitial()",0);
var t=setTimeout("scrollOffsetMidCycle()",halfAnimationPeriod);
var t=setTimeout("scrollOffsetCompleteCycle()",fullAnimationPeriod);
}
successfullyParsed = true;
</script>
</head>
<body onload = dump() >
<marquee id="marquee" width=30 behavior="alternate" scrollamount=1 scrolldelay=1><img src="resources/images/lime.png" width="29" height="29" alt="lime"></marquee>
<pre id="console"></pre>
<script src="../../resources/js-test-post.js"></script>
</body>
</body>
</html>