W3C home > Mailing lists > Public > www-style@w3.org > June 2010

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

From: Henri Sivonen <hsivonen@iki.fi>
Date: Mon, 28 Jun 2010 15:38:43 +0300
Cc: "Robert O'Callahan" <robert@ocallahan.org>, "www-style List" <www-style@w3.org>
Message-Id: <41DDF281-0589-4072-837C-15AD6E3A9766@iki.fi>
To: Anne van Kesteren <annevk@opera.com>
On Jun 25, 2010, at 11:24, Anne van Kesteren wrote:

> On Fri, 25 Jun 2010 02:34:19 +0200, Robert O'Callahan <robert@ocallahan.org> wrote:
>> On Thu, Jun 24, 2010 at 11:49 PM, Henri Sivonen <hsivonen@iki.fi> 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
hsivonen@iki.fi
http://hsivonen.iki.fi/
Received on Monday, 28 June 2010 12:39:20 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:28 GMT