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

Re: Whitespace after </body> (detailed review of parsing algorithm)

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Wed, 22 Aug 2007 20:00:52 -0400
Message-ID: <6b9c91b20708221700u4dc43b8cpc3179ca0c6d8008a@mail.gmail.com>
To: "Ian Hickson" <ian@hixie.ch>
Cc: "Simon Pieters" <simonp@opera.com>, public-html <public-html@w3.org>

On 8/22/07, Ian Hickson <ian@hixie.ch> wrote:
>
> On Wed, 22 Aug 2007, Simon Pieters wrote:
> >
> > (This is part of my detailed review of the parsing algorithm.)
> >
> > How should the following be parsed?:
> >
> >   <body></body> </html>
> >
> > As I read the spec, the space is added to the body element, because that
> > is still the current node even in the "after body" insertion mode. Is
> > this a correct reading of the spec? If so, is it intentional?
>
> Yes and yes. The problem is with handling this case:
>
>    <body>hello</body> world</html>
>
> ...which has to end up the same as:
>
>    <body>hello world</body></html>
>
> ...for legacy reasons.

What about <body><p></p></body>\n</html> (where \n is a newline)?

In Safari and Opera, the newline gets added as a text node after the p
in body. In FF and IE, it does not.

Since a newline is white-space, I assume it's the same deal and Safari
and Opera are right. Correct?

-- 
Michael
Received on Thursday, 23 August 2007 00:00:55 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:48 UTC