blob: b1ecd137a0ab787d863b813b31bce5671a095110 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body style="overflow:hidden">
<div style="height:2000px;"></div>
<!-- Red div to indicate test failure -->
<div style="position: absolute; top: 250px; width: 200px; height: 100px; background-color: red;"></div>
<!-- Green fixed-position, composited div which covers the red div after we scroll -->
<div style="position: fixed; -webkit-transform: translateZ(0); top: 50px; width: 200px; height: 100px; background-color: green;"></div>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
}
onload = function() {
if (window.localStorage.stage == 'two') {
// We went foward and back again.
// If the scroll position is restored correctly the red div won't be visible.
delete window.localStorage.stage;
if (window.testRunner) {
testRunner.dumpAsText(true);
testRunner.notifyDone();
}
} else {
window.localStorage.stage = 'two';
window.scrollTo(0, 200);
setTimeout(function() {
window.location.href = 'resources/fixed-position-scroll-offset-history-restore-2.html';
}, 0);
}
};
</script>
</body>
</html>