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)
Tracking
()
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><q/></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><h1/></code>, for instance,
could be formatted like this:</p>
<p><code>h1:before { content:"Chapter "; }</code></p>
<p>This version is <code>content:<string>;</code>, so the CSS-Datatype
<code><string></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><style type="text/css"><br />
blockquote:before {<br />
content:"cite: \A ";<br />
}<br />
</style></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><br/></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>
Comment 1•24 years ago
|
||
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
Comment 2•24 years ago
|
||
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.
Description
•