[whatwg] CR "entities" and LFCR
Michael A. Puls II
shadow2531 at gmail.com
Mon Jun 11 14:02:12 PDT 2007
On 6/11/07, Anne van Kesteren <annevk at opera.com> wrote:
> On Fri, 08 Jun 2007 20:53:54 +0200, Michael A. Puls II
> <shadow2531 at gmail.com> wrote:
> > I believe Boris told me for FF, newline normalization (including
> > entities) is only done for parsing into the DOM and that any setting
> > of a string property in JS does zero newline normalization. So, if you
> > set \n\r, \n\r is stored as-is (which we visually equivalent as having
> > 2 newlines) and if there needs to be any normalization, it needs to be
> > done by the author of the JS code.
> Some further testing shows that for layout purposes Firefox uses \n as a
> line delimiter in their white space algorithm and \r is simply ignored.
> Internet Explorer uses \r as line delimiter and \n as _space_. Opera uses
> both, but \r\n is a single line break.
Ah, I see.
> can be used for playing with this.
Check what FF does for "x\n\r\nx" and compare to the others. It seems
FF doesn't ignore the \r in this case and doesn't consider it part of
a newline pair, so you get 3 newlines.
More information about the whatwg