This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14275 - This non-normative box is not very clean. After all, using DOM methods or innerHTML also could make DOM not correspond source code of document (heck, older versions of IE did some transformations). Also, as long you won't use async or defer I cannot think
Summary: This non-normative box is not very clean. After all, using DOM methods or inn...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-24 12:42 UTC by contributor
Modified: 2012-01-27 00:31 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2011-09-24 12:42:31 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/content-models.html
Multipage: http://www.whatwg.org/C#document.write()
Complete: http://www.whatwg.org/c#document.write()

Comment:
This non-normative box is not very clean. After all, using DOM methods or
innerHTML also could make DOM not correspond source code of document (heck,
older versions of IE did some transformations). Also, as long you won't use
async or defer I cannot think of case where document.write() would depend on
network latency...

Posted from: 178.36.189.188 by glitch.mr@gmail.com
User agent: Opera/9.80 (Windows NT 6.1; U; pl) Presto/2.9.168 Version/11.51
Comment 1 Ian 'Hixie' Hickson 2011-10-02 18:06:27 UTC
> After all, using DOM methods or
> innerHTML also could make DOM not correspond source code of document

This warning is talking about much more serious cases than that. For example, if you document.write() the string "<plaintext>", the rest of the document is turned to text, regardless. With innerHTML and DOM manipulation, you can't cause the parser to parse parts of the document differently than it otherwise would have.


> Also, as long you won't use
> async or defer I cannot think of case where document.write() would depend on
> network latency...

The case in which it does depend on latency escapes me right now, but I'm pretty sure there is one...

Anyone remember what it is?
Comment 2 Henri Sivonen 2011-10-03 05:48:43 UTC
(In reply to comment #1)
> The case in which it does depend on latency escapes me right now, but I'm
> pretty sure there is one...
> 
> Anyone remember what it is?

Nothing that I know of in Gecko. In some spec draft, there was, IIRC, a case where returning from document.write depended on whether style sheets were loading.
Comment 3 Simon Pieters 2011-10-03 08:07:08 UTC
(In reply to comment #1)
> > After all, using DOM methods or
> > innerHTML also could make DOM not correspond source code of document
> 
> This warning is talking about much more serious cases than that. For example,
> if you document.write() the string "<plaintext>", the rest of the document is
> turned to text, regardless. With innerHTML and DOM manipulation, you can't
> cause the parser to parse parts of the document differently than it otherwise
> would have.

It would be good if you made the note clearer on this point.
Comment 4 Ian 'Hixie' Hickson 2012-01-26 22:29:01 UTC
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: Making text clearer.
Comment 5 contributor 2012-01-26 22:29:37 UTC
Checked in as WHATWG revision r6923.
Check-in comment: Slight tweaks to the anti-document.write() warning.
http://html5.org/tools/web-apps-tracker?from=6922&to=6923
Comment 6 contributor 2012-01-27 00:31:01 UTC
Checked in as WHATWG revision r6924.
Check-in comment: More tweaks to the text (including a comment that describes one of the situations in question).
http://html5.org/tools/web-apps-tracker?from=6923&to=6924