1 <p>This test ensures that document.write after page load is synchronous.</p>
2 <p>You will get a PASS or FAIL alert message after a few seconds.</p>
4 window.onload = function() {
6 // Build a very long string to write.
8 var str = '<p style="display:none">x</p>';
9 for (var i=0; i<LIMIT; ++i)
12 // Write the string and check the DOM immediately and after a small delay.
13 var doc = document.implementation.createHTMLDocument();
15 var immediateElementCount = doc.getElementsByTagName('*').length;
16 setTimeout(function() {
17 var delayedElementCount = doc.getElementsByTagName('*').length;
18 var passOrFail = (immediateElementCount === delayedElementCount ? "PASS" : "FAIL");