gecko/content/base/test/file_bug503473-frame.sjs
Henri Sivonen 3d0ac8ccf0 Test for bug 503473 - Prevent document.write() in the HTML5 parser where prohibited by HTML5. r=bnewman.
--HG--
extra : rebase_source : febd7b2f4fd44960d4a38bcc0d8d8e494833730f
2009-11-04 12:16:40 +02:00

23 lines
533 B
JavaScript

function handleRequest(request, response) {
response.processAsync();
response.setStatusLine(request.httpVersion, 200, "OK");
response.setHeader("Content-Type", "text/html; charset=utf-8", false);
response.write(
'<!DOCTYPE html>' +
'<div></div>' +
'<script>' +
'function doWrite() {' +
' document.write("<p></p>");' +
' parent.done();' +
' document.close();' +
'}' +
'setTimeout(doWrite, 1);' +
'</script>'
);
response.bodyOutputStream.flush();
// leave the stream open
}