Re: [CSS21] [CSS3 Text] Re: Treating carriage return as white space in layout

On Jun 25, 2010, at 11:24, Anne van Kesteren wrote:

> On Fri, 25 Jun 2010 02:34:19 +0200, Robert O'Callahan <> wrote:
>> On Thu, Jun 24, 2010 at 11:49 PM, Henri Sivonen <> wrote:
>>> A (script-inserted) CRLF in <pre> causes one line break and Opera 10.60
>>> beta and two in IE8 and IE9 PP3.
>>> Of these, I think the behavior of IE9 PP3 is the most sensible. (I think
>>> the behavior of Opera 10.60 is an overkill.)
>> I don't think CRLF in <pre> should cause two line breaks. CRLF in "plain
>> text" commonly means one line break.

Literal CRLF in <pre> or text/plain gets normalized to LF before it reaches the CSS layer.

However, avoiding two line breaks is the reason why I initially suggested not giving CR line break behavior in the CSS layer. The behavior that's now on Gecko trunk avoids two line breaks when CRLF ends up in the DOM. The downside is that in the case where a lone CR ends up in preformatted text (either by being numerically escaped or by being script-inserted), there's no line break.

> I think CSS having the same newline rules as every other format would probably make the most sense. I.e. CR, LF, or CRLF.

I think the behavior of Opera 10.60 is entirely logical. I was mainly concerned that performing CRLF normalization on the CSS layer adds complexity in order to address a rare case, so I thought the IE9 behavior (or the behavior that has partially landed on Gecko trunk) made more sense in terms of (lesser) complexity. However, if Gecko layout module owners are OK with CRLF normalization on the CSS layer, I have no objection.

Henri Sivonen

Received on Monday, 28 June 2010 12:39:20 UTC