W3C home > Mailing lists > Public > public-html@w3.org > September 2007

Newlines between comments after root (detailed review of Writing HTML documents)

From: Simon Pieters <simonp@opera.com>
Date: Sat, 01 Sep 2007 18:37:48 +0200
To: public-html <public-html@w3.org>
Message-ID: <op.txzhtaypidj3kv@hp-a0a83fcd39d2.palace.opera.no>

(This is part of my detailed review of the Writing HTML documents section.)

The spec has the following note:

    Note: Space characters before the root html element will be dropped
    when the document is parsed; space characters after the root html
    element will be parsed as if they were at the end of the html element.
    Thus, space characters around the root element do not round-trip. It is
    suggested that newlines be inserted after the DOCTYPE and any comments
    that aren't in the root element.

This is not correct; space characters after the root html element will be  
parsed as if they were at the end of the *body* element.

Also, if you insert newlines after comments that occur after the root  
element then you will increase the number of newlines in the body element  
for each round-trip. The rest of this section goes to great lengths to  
make sure that whitespace round-trips correctly, so perhaps this  
suggestion should be limited to comments before the root element to be  
consistent.

-- 
Simon Pieters
Opera Software
Received on Saturday, 1 September 2007 16:37:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:07 GMT