W3C home > Mailing lists > Public > www-style@w3.org > August 2002

Re: CSS2.1: \A and white-space

From: Bert Bos <bert@w3.org>
Date: Mon, 26 Aug 2002 18:56:50 +0200
Message-ID: <15722.24018.934626.732890@lanalana.inria.fr>
To: www-style@w3.org

fantasai writes:
> 
> I was flipping through CSS2.1, and I came across the passage about \A - 
> 
> http://www.w3.org/TR/2002/WD-CSS21-20020802/generate.html#content :
>    #  Authors may include newlines in the generated content
>    #  by writing the "\A" escape sequence... This inserts a
>    #  forced line break, similar to the BR element in HTML.
> 
> A while ago, Boris Zbarksy wrote
>   | Wouldn't you need to also set white-space:pre to get things like
>   | \A to render? I think \A puts a newline character in the text, but
>   | after that the text is laid out the way any text with a newline
>   | would be and the whitespace (including newlines) is collapsed into
>   | just spaces.
> 
> Which makes sense and is how Mozilla implements the 'content' property.
> After all, \A is just an escape sequence that means "newline". CSS2.1,
> however, seems to override that expectation with the wording of its \A
> explanation and the following example.

No, the 'white-space' property has no effect on '\A', since the '\A'
is not inserted into the *input* of the CSS renderer, but into the
*output*. Whitespace in the input is a form of mark-up and is thus
interpreted by the HTML (or XML) parser and further undergoes
transformations by the CSS renderer. But the '\A' is simply part of
the rendered output. You can regard it as a glyph or as a control
code, but the term "whitespace" doesn't apply to it.

It is the same situation as when you do this:

  p:before {content: "<em>"}

That simply inserts four literal characters into the ouput, it does
not create an EM element.



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Monday, 26 August 2002 12:56:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:15 GMT