blob: 7697b50b79c013681aaa56d5fb31582e0351906b [file] [log] [blame]
<!DOCTYPE html>
if (window.testRunner)
function log(message)
document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
<p>In this test, we set a new scrollTop for a scrolling div, and then we make the div display:none. The test ensures that when we bring the div back by giving it a display value of block, that we also restore its scroll position. The test also ensures that we are able to set a new scrollTop value of 0 after that.</p>
<div id="scroller" style="height: 20px; overflow: scroll;">
<div style="height: 60px;"></div>
<pre id="console"></pre>
a = document.getElementById('scroller');
a.scrollTop = 20; = 'none';
a.scrollTop = 20; = 'block';
log('scrollTop after restoring div: ' + a.scrollTop + '\n');
a.scrollTop = 0;
log('scrollTop after setting scrollTop back to 0: ' + a.scrollTop + '\n');