This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html Multipage: http://www.whatwg.org/C#document.write() Complete: http://www.whatwg.org/c#document.write() Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html Comment: open() doesn't always produce an insertion point Posted from: 98.110.194.206 by bzbarsky@mit.edu User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:23.0) Gecko/20130419 Firefox/23.0
Specifically, consider this testcase: var newDocument = document.implementation.createHTMLDocument( '' ); newDocument.write( whatever ); In this case, I believe both the ignore-opens-during-unload counter and the ignore-opens-during-unload counter are 0, so step 3 of http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-document-write calls open(). Step 2 of http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-document-ope aborts the steps, since the document is not active. But write() makes no allowance for that, only for the user refusing for the document to be unloaded, and starts talking about insertion points, which is nonsensical in this case: there is no parser.
Should document.write() just abort on non-active documents? document.open() does, it seems like an oversight that document.write() doesn't.
That would make sense to me, yes.
Checked in as WHATWG revision r7869. Check-in comment: Make document.write() a no-op on non-active documents. http://html5.org/tools/web-apps-tracker?from=7868&to=7869