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

Re: CR and LF in the input stream / as NCRs (detailed review of parsing algorithm)

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Fri, 3 Aug 2007 06:46:03 -0400
Message-ID: <6b9c91b20708030346g1bce1d8ehe6f2662055156055@mail.gmail.com>
To: public-html <public-html@w3.org>


Here's a demo of those findings:
(Note that this is with the pre element specifically. There seem to be
exceptions depending on what element you test.)


(In a zip file so you can download it in-tact.)

Both Opera and IE give the correct rendering for all those cases.

Firefox and Safari fail to render 2 of them correctly. (See the entity
ones where line1 and line2 are separated by a newline.)

Newline Normalization:

Opera doesn't do any normalization for attributes or data.
Firefox and Safari don't do any normalization for attributes, but
normalize to \n for data (keeping the 2 quirks that cause the
rendering differences in mind)

IE does the same as Safari and Firefox minus the 2 exceptions, but
instead of normalizing to \n, it normalizes to \r.

So, minus the Safari and Firefox entity quirks:

Safari and Firefox normalization for data is:

\r -> \n
\n -> \n
\r\n -> \n
\n\r -> \n\n

IE's normalization for data is:

\r -> \r
\n -> \r
\r\n -> \r
\n\r -> \r\r

Given that:

1. newlines in attribute values should not be normalized.
2. newlines in data should be normalized to \n like Firefox and Safari
(but without the 2 quirks).

Received on Friday, 3 August 2007 10:46:07 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:25 UTC