This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
It seems that the current spec definition of document.close() matches Gecko. However, Trident, WebKit and Presto all try to tokenize synchronously on document.close() in addition to inserting the EOF character in the stream. Presto seems to tokenize to EOF. WebKit tokenizes until EOF or the earliest external-script </script> whichever comes first. Trident tokenizes but I'm not sure how far. (I gave up testing before I found out.) Since 3 out of 4 tokenize at least somewhat, I think document.write() should attempt to tokenize. However, I think it should bail out if the tokenization causes the parser to block, since that's more implementable in Gecko than what Presto does. Live DOM URLs of interest: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/276 Shows that Gecko doesn't tokenize but WebKit and Presto tokenize. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/277 Shows that Trident tokenizes. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/278 Shows that WebKit bails out but Presto doesn't.
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Accepted Change Description: see diff given below Rationale: Concurred with reporter's comments.
Checked in as WHATWG revision r4241. Check-in comment: Make document.close() more evil. http://html5.org/tools/web-apps-tracker?from=4240&to=4241