Closed Bug 98906 Opened 24 years ago Closed 24 years ago

<string> Datatype in CSS (content-Property) is not correctly interpreting \A

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 66585

People

(Reporter: Christian.Hujer, Assigned: dbaron)

Details

<h4>Introduction</h4> <p>The Recommendation for CSS Level 2 describes in section 12.2 the content property (<a href="http://www.w3.org/TR/REC-CSS2/generate.html#content">http://www.w3.org/TR/REC-CSS2/generate.html#content</a>). Mozilla works fine with this content property. For instance it is possible to write a stylesheet for XML documents that display a <code>&lt;q/&gt;</code>-Element like in HTML.</p><p>A stylesheet for this looks like:</p> <p><code>q:before { content:open-quote; } q:after { content:close-quote; }</code></p> <p>It also works to include Strings. <code>&lt;h1/&gt;</code>, for instance, could be formatted like this:</p> <p><code>h1:before { content:"Chapter "; }</code></p> <p>This version is <code>content:&lt;string&gt;;</code>, so the CSS-Datatype <code>&lt;string&gt;</code> is used.</p> <h4>And here comes the bug</h4> <p>The section 12.2 says: <q>Authors may include newlines in the generated content by writing the "\A" escape sequence in one of the strings after the 'content' property.</q></p> <p>The section 4.3.10 Strings also says: <q>A string cannot directly contain a newline. To include a newline in a string, use the escape "\A" (hexadecimal A is the line feed character in Unicode, but represents the generic notion of "newline" in CSS). See the 'content' property for an example.</q></p> <p>This doesn't work in Mozilla. Including "\A " in a string does not generate a line break.</p> <p>The following example illustrates this:</p> <p><code>&lt;style type="text/css"&gt;<br /> blockquote:before {<br /> &nbsp;&nbsp;content:"cite: \A ";<br /> }<br /> &lt;/style&gt;</code></p><p>This should render Blockquotes with the text "cite: " and a newline in front of it. The newline is missing.</p> <h4>Annotations</h4> <p>1. The example Stylesheet provided in Appendix A of the CSS Level 2 Recommendation suggests to format the <code>&lt;br/&gt;</code>-Element with <code>br:before { content: "\A" }</code></p> <p>2. Opera does not interpret "\A" as newline, too, Opera has the same bug. Opera does <em>not</em> state this lack of CSS Level 2 implementation in <a href="http://www.opera.com/docs/specs/#css">http://www.opera.com/docs/specs/#css</a>, where they usually write what they do and do not support.</p>
FWIW, it works if you use display: block in the :after or :before style definitions. *** This bug has been marked as a duplicate of 66585 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
I meant it works if you use white-space: pre; // not display: block;
You need to log in before you can comment on or make changes to this bug.